When I write a driver, I want to uncache the registers of the peripheral, that means, I want to access the registers directly and bypass the cache. How to do it in C? Thanks!
That is far, far out of the scope of the C programming language. It's a hardware and operating system issue, so what OS are you using? And what hardware?
Generally speaking though, adress ranges used for IO registers should never be cached in the first place.
In many compilers you can declare the variable accessing registers as 'volatile'. This tells the compiler that the variable (register) always has to be read & written. So it isn't "cached" in the compilers optimization process as usual variables do.