From owner-freebsd-hackers Sat Oct 10 03:25:19 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA19026 for freebsd-hackers-outgoing; Sat, 10 Oct 1998 03:25:19 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA19012 for ; Sat, 10 Oct 1998 03:24:52 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.9.1/8.9.1/Spinner) with ESMTP id RAA15119; Sat, 10 Oct 1998 17:55:36 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199810100955.RAA15119@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: Roger Hardiman cc: hackers@FreeBSD.ORG Subject: Re: Contiguous memory allocation In-reply-to: Your message of "Sat, 10 Oct 1998 09:48:09 +0100." <361F1F49.6E4F@cs.strath.ac.uk> Date: Sat, 10 Oct 1998 17:55:35 +0800 From: Peter Wemm Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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