Actually, Scott, you’ve got the contract wrong. (See older posts by me on
this topic. I know that OSR has been teaching this for years, but with the
wrong contract.)
If your translated resources are in port space, you don’t map. Period.
(The exception was MIPS, which is gone. Alpha and PowerPC and Itanic all
followed the contract I’m describing now.) If the translated resources are
in memory space, you map. Period.
Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group
This post implies no warranties and confers no rights.
“Scott Noone” wrote in message news:xxxxx@ntdev…
“Tim Roberts” wrote in message news:xxxxx@ntdev…
At one time, it WAS necessary to map the I/O space, and some people
still do so out of habit. Way back in the mid-1990s, NT also ran on
Alpha, MIPS, and PowerPC processors. Those processors do not have the
concept of “I/O ports”, so PCI devices with I/O space had to be mapped
into part of physical memory.
Just to clarify…This is still an issue on Windows due to the Itanium,
which doesn’t have I/O ports either
(all Itanium jokes aside).
The key then is that you have to dynamically determine *where* your ports
end up on a particular
platform at runtime, which is where the raw and translated resources come
in. Your raw resource
indicates that you have a port on your device and your translated resource
indicates that it’s either
in port space (x86/x64, you don’t have to map) or in memory space (IA64, you
*do* have to map).
The wdfdio driver demonstrates this.
Just want to make it clear that mapping or not mapping isn’t an arbitrary
decision up to the driver
writer.
-scott
–
Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com
“Tim Roberts” wrote in message news:xxxxx@ntdev…
Michael Wade wrote:
In the wdfdio.cpp file, DioEvtPrepareHardware function I see that it’s
iterating over the resource types, and in the CmResourceTypePort case
it is just setting the device context BaseAddress variable to the
LowPart of the translated resource. But why is it not necessary to
map the address? Like in the ResourceTypeMemory?
At one time, it WAS necessary to map the I/O space, and some people
still do so out of habit. Way back in the mid-1990s, NT also ran on
Alpha, MIPS, and PowerPC processors. Those processors do not have the
concept of “I/O ports”, so PCI devices with I/O space had to be mapped
into part of physical memory.
x86 and x64 processors don’t have to worry about that.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.