0

I'm trying to make an UIO driver in ARM Cortex-A9 processors. These processors use ARMv7-A architecture. I'm stuck with cache operations from user space. Need help in how to perform cache flush and invalidate from userspace app. ARMv7-A has both instruction cache and data cache, requirement is data cache flush and invalidate.

Gone through https://community.arm.com/groups/processors/blog/2010/02/17/caches-and-self-modifying-code. Tried __clear_cache() provided GCC. It didn't work. I am not sure, thinking that it flushes only instruction cache.

  • __clear_cache() didn't work. – Jyothi Vemulapalli Dec 11 '15 at 09:37
  • See: [Clear and invalidate ARMv7 CPU cache in Linux](http://stackoverflow.com/questions/6046716/how-clear-and-invalidate-arm-v7-processor-cache-from-user-mode-on-linux-2-6-35) for more on how to allocate memory for the flush. Did you mmap? The CP15 registers to clear a cache are prohibited in *user mode*. I put a new answer for you in the other question if `clear_cache` can not work, manually accessing the entire cache is the only way to evict from user mode without OS support; it is better to keep the info together. – artless noise Dec 11 '15 at 15:01
  • ok. I got it. Just like to understand, what may be the use of __clear_cache() gcc built-in. – Jyothi Vemulapalli Dec 14 '15 at 10:40

0 Answers0