What to pass to mmap_device_io() ?

I’ve got I/O PCI card, that has io address = 0xdc00;

dev_info.CpuBaseAddress[2] returns 0xdc01
and
PCI_IO_ADDR(dev_info.CpuBaseAddress[2]) returns 0xdc00;

example code from QNX site has line:
io_base = mmap_device_io(dev_info.BaseAddressSize[2], dev_info.CpuBaseAddress[2]);

is it correct?
or it should be like this:
io_base = mmap_device_io(dev_info.BaseAddressSize[2], PCI_IO_ADDR(dev_info.CpuBaseAddress[2]));
?

It is cleaner to use the PCI_IO_ADDR() macro to have more portable code (mask out some bits within that value that may on other platforms contain additional information that are not part of the physical I/O address itself) but for x86 there is no difference.

Regards,
Albrecht

I’ve got this problem on x86
and I have to pass PCI_IO_ADDR( base_io ) to mmap_device_io();

when I use example from Talking to hardware under QNX Neutrino by Dave Donohoe,
I’ve got too big base_io;

the example is wrong - look at source PCI_IO_ADDR() mmap_device_io() for X86 systems :slight_smile: