Firefox
Member
Hi everyone! I'm in need of a bit of caching-related assistance!
I've got a small assembly language loop running on the 940T, and it's incrementing a counter in a register and writing the value to a location in shared memory.
On the 920T I'm running a C program and I've got the shared memory mmap()ed.
I'm reading the location that's being written by the 940T using a volatile unsigned long*. I do that once a second in a loop, sleep()ing inbetween reads.
The problem is that whatever count value my C program sees first is the value it sees forever more.
I've tried msync(), running a loop that reads 16kB from somewhere else via another volatile unsigned long *, and even munmap()ing and re-mmap()ing the data memory between reads. And all three together. But whatever I do I can't get rid of whatever value it reads first!
How can I flush the 920T's data cache without upsetting Linux, or declare my shared memory region uncached? :unsure:
I'm running my 940T code at 0x03000000 and my shared data memory is inside a 512kB block at 0x03500000.
I've got a small assembly language loop running on the 940T, and it's incrementing a counter in a register and writing the value to a location in shared memory.
On the 920T I'm running a C program and I've got the shared memory mmap()ed.
I'm reading the location that's being written by the 940T using a volatile unsigned long*. I do that once a second in a loop, sleep()ing inbetween reads.
The problem is that whatever count value my C program sees first is the value it sees forever more.
I've tried msync(), running a loop that reads 16kB from somewhere else via another volatile unsigned long *, and even munmap()ing and re-mmap()ing the data memory between reads. And all three together. But whatever I do I can't get rid of whatever value it reads first!
How can I flush the 920T's data cache without upsetting Linux, or declare my shared memory region uncached? :unsure:
I'm running my 940T code at 0x03000000 and my shared data memory is inside a 512kB block at 0x03500000.