Subject: Re: mmap'ing device driver memory
To: Michael Richardson <mcr@solidum.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 12/14/1998 19:49:38
On Mon, 14 Dec 1998 16:57:05 -0500
Michael Richardson <mcr@solidum.com> wrote:
> Am I correct that there is no call like "machine_ptob()" that can be used
> by MI device drivers that want to map memory that is on an expansion card
> (i.e. PCI) into user space?
> I see that, for instance, the mmap() code for the VGA drivers is all MD.
That's correct. I have not finished my bus_space_mmap() proposal yet.
> Second, due to lack of actual hardware, I'm simulating part of my card's
> memory with system ram. Is there something I should call other than than
> malloc() to get memory that is safe for mmap()'ing?
See bus_dma(9).
> Or should I really switch to using the bus_dma stuff? It isn't clear to me
> how to do this although Jason's paper helped a lot...
Take a look at e.g. the eap audio driver.
Jason R. Thorpe thorpej@nas.nasa.gov
NASA Ames Research Center Home: +1 408 866 1912
NAS: M/S 258-5 Work: +1 650 604 0935
Moffett Field, CA 94035 Pager: +1 650 940 5942