Date: Sat, 10 Oct 1998 17:55:35 +0800 From: Peter Wemm <peter@netplex.com.au> To: Roger Hardiman <roger@cs.strath.ac.uk> Cc: hackers@FreeBSD.ORG Subject: Re: Contiguous memory allocation Message-ID: <199810100955.RAA15119@spinner.netplex.com.au> In-Reply-To: Your message of "Sat, 10 Oct 1998 09:48:09 %2B0100." <361F1F49.6E4F@cs.strath.ac.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
Roger Hardiman wrote: > Hi all, > > VM Contiguous Allocation. > > The bt848 driver could really do with contiguous memory allocation > being available well after boot time. > > Currently, the driver has to allocate the memory buffer the > bt848 chip copies frames into at boot time. (about 700k) > > It would be great if the driver could allocate this buffer at run-time. > It would need to be contiguous and non-swappable. > > Any anyone help hack the kernel to achieve this? Have a look at some code that uses contigmalloc(). It's not particularly intuitive, but it does work. Some things that use it are busdma_machdep.c and isa.c (the isa dma code). You can request things like: Give me 16K of physically contiguous data that is aligned on a 16 byte boundary, and is entirely within the same 64K window. Of course, there are no guarantees that you will be able to get a large chunk that is physically contiguous, but you can only try. The VM system will try quite hard to make the space for your request, even if it has to swap just about everything out to disk. Cheers, -Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810100955.RAA15119>