I'm trying to see the contents of cache register and the status of dirty bit in c7 before and after cleaning D cache. This link:
https://developer.arm.com/docs/ddi0198/latest/programmers-model/register-descriptions/cache-operations-register-c7 says that "If the cache contains any dirty lines, bit 30 is set to 0. If the cache contains no dirty lines, bit 30 is set to 1." I have a variable c7Value initialized to 15(Random number)
"tc_loop: \n"
"MRC p15, 0, %[c7Value], c7, c10, 3 \n" //Read value of c7 after cleaning
"BNE tc_loop \n"
:[c7Value] "=r"(c7Value)
);
When I print the value of c7Value after the above loop, the value comes out to zero. I thought that only the 30th bit will be set to 0, if it finds any cache line dirty.
Also, is there a way to just read the content of c7 without cleaning it?
Other registers like c1 can be read as :"MRC p15, 0, R1, c1, C0, 0", but there is no instruction to read c7.
Therefore, can someone please tell me know how to print the cache contents and/or read contents of c7(to check dirty status)?