[EMAIL PROTECTED] <> said on : > I'm currently struggling with some application that tries to > access PCI-E memory by mmaping address found in > /sys/bus/pci/devices/<device>/resource > > mmap() fails with "invalid argument" error, apparently > because on 460EX PCI addresses are 36-bit. > > What is the correct way of accessing PCI-E from userspace on this > platform.
What works for me is using the mmap64 as in the following example to map the physical address, fd is the file descriptor for /dev/mem off64_t offset = static_cast<off64_t>(your physical address); void * const p = mmap64(0,256,PROT_WRITE|PROT_READ,MAP_SHARED,fd,offset); The only thing to note is that the address you pass should be aligned to the page boundry even though some devices are not. _______________________________________________ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded