Subject: Re: Allocating physical memory in kernel
To: None <port-vax@NetBSD.org>
From: Jochen Kunz <jkunz@unixag-kl.fh-kl.de>
List: port-vax
Date: 06/08/2004 23:47:18
On Tue, 08 Jun 2004 17:54:14 -0700
Blaz Antonic <blaz.antonic@siol.net> wrote:

> 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.
A sequence of
bus_dmamem_alloc()
bus_dmamem_map()
bus_dmamap_create()
bus_dmamap_load()
should do what you want. See sys/dev/sbus/isp_sbus.c:isp_sbus_mbxdma()
or sys/arch/hp700/gsc/if_iee_gsc.c:iee_gsc_attach() for an example.
-- 



tschüß,
         Jochen

Homepage: http://www.unixag-kl.fh-kl.de/~jkunz/