Search code examples
c++cwindowsembeddedwindows-ce

Which file configures caching on Windows Embedded Compact 7.0?


Which file configures caching on Windows Embedded Compact 7.0?

(For example, on VxWorks I can modify OS caching settings in SysLib.c)

How do I turn memory caching off?


Solution

  • What do you mean with "turning caching off"? If you just need to disable caching for specific memory blocks you allocate then you can use the PAGE_NOCACHE flag of VirtualAlloc (or implement a custom heap on top of pages allocates in this way if you need small blocks). If you need to disable cache for the whole system you need to modify the BSP and, in particular, the startup part and the cache flushing functions. In this way you should be able to disable L2 caching. On some architectures L1 cache is managed by the kernel (ex: on ARM), so no way to disable it easily. But why do you want to disable caching in the whole OS?