Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Nov 1995 20:35:33 +0100
From:      Andres Vega Garcia <Andres.Vega_Garcia@sophia.inria.fr>
To:        hackers@freebsd.org
Subject:   Notion of time in kernel + malloc
Message-ID:  <199511201935.UAA16241@fun.inria.fr>

next in thread | raw e-mail | index | archive | help
	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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511201935.UAA16241>