From owner-freebsd-hackers Mon Nov 20 11:42:50 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id LAA00838 for hackers-outgoing; Mon, 20 Nov 1995 11:42:50 -0800 Received: from fun.inria.fr (fun.inria.fr [138.96.24.57]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id LAA00819 for ; Mon, 20 Nov 1995 11:42:37 -0800 Received: by fun.inria.fr (8.6.12/8.6.12) id UAA16241; Mon, 20 Nov 1995 20:35:35 +0100 Message-Id: <199511201935.UAA16241@fun.inria.fr> X-Mailer: exmh version 1.6.2 7/18/95 To: hackers@freebsd.org Subject: Notion of time in kernel + malloc Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 20 Nov 1995 20:35:33 +0100 From: Andres Vega Garcia Sender: owner-hackers@freebsd.org Precedence: bulk Hello, I'm adding some code to the kernel in order to modify the packet scheduling policy (currently FIFO) to Fair Queueing, and I need to have a notion of time (seconds (or tens of seconds) elapsed since ...). => Can I use just gettimeofday?, or there is a better way? (The #ifdef in sys/time.h disables the prototype for gettimeofday when KERNEL is defined) I have realized that in order to do malloc I need the "kernel" call to malloc. As this is related with the ethernet drivers (and ppp), I decided to use: malloc(sizeof(fs_ctx_t),M_DEVBUF,M_KERNEL) for the main structures and malloc(sizeof(fs_ses_t),M_DEVBUF,M_NOWAIT) for the secondary => Is the above right? Thank you ------- Andres Vega Garcia INRIA - Sophia Antipolis 2004, Route des Lucioles B.P. 93 06902 Sophia Antipolis Cedex, France avega@sophia.inria.fr (+33)93.65.76.78 Fax:(+33)93.65.77.65 or 66