tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to map PCI memory to user space ?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Dec 10, 2012, at 8:51 PM, Rohan Akela wrote:

I am trying to map PCI device memory  using mmap()  to user space for
powerpc based platform.

I assume this means macppc?
If not you probably need options INSECURE in your kernel.

I came across previous email thread where it
is mentioned that it is possible to mmap PCI memory using pcimmap()
implemented in dev/pci/pci_usrreq.c.

I wrote a small application to map the the PCI memory but mmap()
always return "invalid argument". The example is given below.

Are you running it as root or as an unprivileged user?

Does mmap() using pcimmap() works?

Yes, that's what the Xserver uses. If X works with a driver other than wsfb then so should your code.

Is there a sample code that illustrates how to map PCI memory using mmap(). ?

xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c

have fun
Michael

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQEVAwUBUMnuoMpnzkX8Yg2nAQIbfAgAsq0JotJjfoxV+/2KZNTq6panfXfZjEYR
aDfs6td1+IkQXAPvj/vqUAdJ9c0/RE5CmUi8DNH9jRFJLFrrh2t3VMgJmsQVEA19
3Je9Y89POucDxxuarY4qfl7OVaPh2VH8T4aUwzsmjQQ4BcXe8FRyjocYrfpZoEsr
Wwd6yjd4pj95xiSU/2nmpeCaGa+hOhmm76ulVjvEdsAnj48ia+0qQ/mepE+us3hV
31Qgrbyu5nwtReV0nY/TT/Ts2R1wO/vka/PNHT/27PiHeeXpW6HbJBLUwux1DPt9
b5CntI0TZ1K20ymxowCptYHWzEAc4AtXDmlYzsdPiPSU0Un3KjKG9w==
=6qvi
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index