Reputation: 2059
My scenario is as follow:
I tried to declare the structure as below, but without the invalidate/flush cache, the read/write does not take effect.
typedef volatile struct { u32 front; u32 rear; u32 n_msg; u32 offset; } queue_ctl_t;
May anyone please tell me the correct way to access this shared memory region. I just wonder how some network drivers (for network cards on PCIE bus) can access the data consistently without doing the invalidate/flush cache. Any suggestions are appreciated, thank a lot!
Upvotes: 1
Views: 404
Reputation: 239011
You should be using ioremap_nocache()
to map the memory regions in question, and reading/writing them using the ioread*()
and iowrite*()
functions.
Upvotes: 1