Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to uncache a memory area in C?

Status
Not open for further replies.

davyzhu

Advanced Member level 1
Advanced Member level 1
Joined
May 23, 2004
Messages
494
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
oriental
Activity points
4,436
how to uncache

Hello all,

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!

DAVY
 

how to uncache memory

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.


Mik
 

Use volatile as M!k suggests

Have a look here

**broken link removed**

/Bingo
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top