Subject: Re: Allocating physical memory in kernel
To: Blaz Antonic <blaz.antonic@siol.net>
From: Matt Thomas <matt@3am-software.com>
List: port-vax
Date: 06/08/2004 12:11:49
At 05:54 PM 6/8/2004, Blaz Antonic wrote:
>Hello,
>
>How does one allocate a block of memory of given size, say 64 KB, like
>malloc(), except that i want this block to be (A) aligned to 64 KB
>boundary in memory space, (B) be a contiguous block of physical memory
>and (C) i need to know its physical address rather than virtual address.
>
>There are some other *alloc() functions i noticed but no docs describing
>them so i was wondering if anybody knows how to get that block allocated
>as described above - please let me know ASAP, i'm stuck with my LCG FIFO
>code (i overflow FIFO in short-circuit mode so i need to operate with
>real FIFO and this requires said block of memory).

Since this is for a device, you should be using bus_dmamem_alloc and
related functions.  You need to use a segment count of 1 to force a
large contiguous block.

-- 
Matt Thomas                     email: matt@3am-software.com
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA              disclaimer: I avow all knowledge of this message.