Hi,

I just need a bit of help understanding something. In OEMAddresstable
there is a set of virtual to physical address mappings. When an app or driver
running in user
mode needs to access a memory mapped device i read in documentation that it
must call virtualalloc to reserve some virtual memory and then virtual copy
to map
it to the physical address. However this mapping is already done in
OEMAddresstable, i would expect all memory mapped devices to be setup here,
anyway this is what i have seen in MainstoneII BSP for example and others.
So why does one need to call Virtualalloc and VirtualCopy. Hope it is easy
for someone to explain what i don't understand.

Regards
ms

Re: Question on VirtualAlloc and VirtualCopy by Steve

Steve
Thu Apr 21 17:09:45 CDT 2005

Forget about what you read in the docs. It's at best misleading - the
mappings in OEMAddresTable are for the OAL and the ISRs contained in the OAL
ONLY. Drivers should use TransBusAddrToVirtual()/TransBusAddrToStatic() (in
V5.0 you should use BusTranBusAddrXXX)
The virtual version of these APIs maps a bus specific address to a virtual
address for the driver to use. The Static version maps the address into the
same region as OEMAddressTable does. The reason for static mapping is that
the ISR may need to access the device hardware and cannot use process
relative mapping since the ISR interrupts whatever random process happens to
be running at the time the interrupt occurs. So if your driver uses an
Installable ISR (IISR) you may need to have the ISR access the hardware so
you need to do static mapping to pass the device address to the IISR

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