Date: Thu, 27 Feb 1997 17:29:28 -0800 From: David Greenman <dg@root.com> To: jpt@msc.edu (Joseph Thomas) Cc: hackers@FreeBSD.ORG Subject: Re: Assumptions about kmem_malloc()... Message-ID: <199702280129.RAA05746@root.com> In-Reply-To: Your message of "Thu, 27 Feb 1997 17:25:59 CST." <199702272326.RAA01886@ww.msc.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
> o Other then contigmalloc(), is there a way to malloc contiguous >physical memory greater then one page? No; we created vm_page_alloc_contig/contigmalloc specifically for this purpose, and it's the only mechanism that exists to do this. > The driver waits to malloc memory until microcode is > downloaded to the NIC (Fore PCA200E). Since the download is > user initiated, and because we'd like to move toward loadable > modules, the prospect of having large amounts of contiguous > memory is greatly dimished by the time we ask for it. The memory allocated with contigmalloc can be released later via kmem_free(). > o What other hidden gotchas are there in working with DMA and >device drivers? Well, contiguous allocation is always the most common thing to get people. :-) The only other thing you should be aware of is that allocation of contiguous memory during normal system operation isn't guaranteed (in fact, will likely fail)...so you should allocate whatever you need contiguous during the device attach and olny release it later if you know you won't need it. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702280129.RAA05746>