So, I want to create a resource manager that gives me access to some
special hardware on our PPC-based box. We’re just starting out, using
QNX 6.1.0. The code is being ported from VxWorks (5.3.1).
Looking through the manual this is (generally) how I implemented it;
since I don’t actually have hardware yet , I can’t really test it but
I wanted to make sure I’m not totally off-base.
First, I used mmap_device_memory() to create a memory-mapped space for
the device. I used the physical address as the address (last)
argument. I used NULL as the pointer, and 0 for the flags, and
PROT_READ|PROT_WRITE|PROT_NOCACHE as the protection.
Then, when I want to access a specific bit of physical memory, I first
translate the physical address into a virtual address by calculating the
offset from the physical address start and adding that to the mmap()
return pointer, then I use the in8(), out8(), etc. macros defined in
ppc/inout.h to do the actual get/set of the values, passing them this
I see that for PPC, these macros already do EIEIO, etc.
Did I get it right?
Paul D. Smith <firstname.lastname@example.org> HASMAT–HA Software Mthds & Tools
“Please remain calm…I may be mad, but I am a professional.” --Mad Scientist
These are my opinions—Nortel Networks takes no responsibility for them.