What's the difference between MmMapIoSpace() and VirtualAlloc() +
VirtualCopy(),
since both of them seemed to convert a physical io address to a virtual
address.

Thank you!

Re: MmMapIoSpace() v.s. VirtualAlloc() + VirtualCopy() by Steve

Steve
Sat Oct 23 08:35:25 CDT 2004

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



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
>
>



Re: MmMapIoSpace() v.s. VirtualAlloc() + VirtualCopy() by Steve

Steve
Sun Oct 24 03:15:06 CDT 2004

It's better to use BusTransBusAddrToVirtual() it covers much more and makes
for a bus agnostic driver.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com



Re: MmMapIoSpace() v.s. VirtualAlloc() + VirtualCopy() by olol

olol
Sun Oct 24 04:25:59 CDT 2004

Thank you, Steve!

I think I can try it when I use PB5.0, though I think it is a little more
complex.
I hope there will be some more sample codes then :)

But I am using PB4.2 now.



"Steve Maillet (eMVP)" <nospam1@EntelechyConsulting.com> wrote in message
news:uL5DYGauEHA.3524@TK2MSFTNGP15.phx.gbl...
> It's better to use BusTransBusAddrToVirtual() it covers much more and
> makes for a bus agnostic driver.
>
> --
> Steve Maillet
> EmbeddedFusion
> www.EmbeddedFusion.com
> smaillet at EmbeddedFusion dot com
>
>



Re: MmMapIoSpace() v.s. VirtualAlloc() + VirtualCopy() by Steve

Steve
Mon Oct 25 21:58:02 CDT 2004

in V4.2 you can use TransBusAddrToVirtual()

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com



Re: MmMapIoSpace() v.s. VirtualAlloc() + VirtualCopy() by olol

olol
Mon Oct 25 22:16:14 CDT 2004

Thank you, Steve!

"Steve Maillet (eMVP)" <nospam1@EntelechyConsulting.com> wrote in message
news:ObP5eewuEHA.3976@TK2MSFTNGP09.phx.gbl...
> in V4.2 you can use TransBusAddrToVirtual()
>
> --
> Steve Maillet
> EmbeddedFusion
> www.EmbeddedFusion.com
> smaillet at EmbeddedFusion dot com
>
>