Re: MmMapIoSpace() v.s. VirtualAlloc() + VirtualCopy() by olol
olol
Sat Oct 23 22:54:34 CDT 2004
Thank you, Steve!
So if I write a driver to read the registers of a reference board (Board
level register),
do you think it's better to use MmMapIoSpace() to map the address?
I am not sure because I found that in Intel Lubbock(PXA250 reference board)
BSP,
it use VirtualAlloc() + VirtualCopy().
"Steve Maillet (eMVP)" <nospam1@EntelechyConsulting.com> wrote in message
news:ubAZrUQuEHA.908@TK2MSFTNGP11.phx.gbl...
> MmMapIoSpace is a wrapper around VirtualAlloc + VirtualCopy and should be
> preferred over the lower level functions. It hides the subtleties of the
> lower level functions that are often difficult to track when missed.
> However there are subtleties of using MmMapIoSpace involving bus and I/O
> vs. Memory Mapped access on different CPUs and busses so it's actually
> still better yet to use BusTransBusAddrToVirtual() to request the bus
> driver to translate the appropriate bus specific address into the system
> accessible address in virtual space for the process.
>
> --
> Steve Maillet
> EmbeddedFusion
> www.EmbeddedFusion.com
> smaillet at EmbeddedFusion dot com
>
>