Accessing PCI memory

I am trying to read and write to an in-house PCI card. The memory
address for the card is known and using mmap I can write to the card and
the card responds, but I can’t read any data that the card has written
to this memory address. I’m thinking that I need to use something
else to link the physical mem address of the card to my mmap
pointer,(mem_offset, shm_open) but I’m not sure what it is, Any
ideas?..


Thanks,

Ryan

Make sure you use mmap_device_memory(), with the PROT_READ | PROT_WRITE |
PROT_NOCAHCE flags. If you don’t specify PROT_NOCACHE, you’ll probably get a
CPU cached version of what used to be on the card. Be sure to check for
error returns from mmap_device_memory() as well- there may be page alignment
issues you have to resolve.

-Warren


“ryan fauth” <ryan@fauth.com> wrote in message
news:3A2D0B55.B509EF07@fauth.com
| I am trying to read and write to an in-house PCI card. The memory
| address for the card is known and using mmap I can write to the card and
| the card responds, but I can’t read any data that the card has written
| to this memory address. I’m thinking that I need to use something
| else to link the physical mem address of the card to my mmap
| pointer,(mem_offset, shm_open) but I’m not sure what it is, Any
| ideas?..
|
|
| Thanks,
|
| Ryan
|