From what I have been able to understand, in order to get a piece of data to go into the minicache instead of the D-Cache, on a StrongArm, it requires setting some of the flags in the MMU. I'm just wondering is there a way to actually allocate a page of memory through WinCE with these attributes, without me having to go messing with the pagetable, which most likely is protected?
Has anyone played around with this? I think I have managed to control the read buffers but the minicache elludes me at this point.
Exocet wrote:
I think I have managed to control the read buffers but the minicache elludes me at this point.
How do you managed to control the read buffer ?
StephC - page 52 of the SA1110 manual covers the read buffer (it's controlled via the co-processor interface, rather than page-tables).
Just to give you all an update on my progress. I have figured out that I can use VirtualAlloc to get Windows CE to allocate pages of main memory with specific attributes, being READONLY, READWRITE, NOCACHE etc.. unfortunately there does not appear to be a nonbufferable option. Did microsoft completely forget about this feature? or is there some undocumented NONBUFFERABLE option out there?
For those of you unfamiliar with the ARM MMU if cacheable and bufferable are enabled your data will be stored in the main D-Cache, otherwise if cacheable and nonbufferable are enabled your data goes to the minicache.
Hi.
I was working on that issue myself. I spend to much time reading all the xscale, arm and ce documentation.
I also saw the VirtualAlloc, and infact that's the place where the minicache-option would make most sense (since you don't allocate new physical memory, you just change some cache-access bits).
Also I'm pretty sure that the coprocessor-register to control the caches will not help. You can enable/disable as often as you want, unless your descriptor has the correct bits set it won't access the mini-cache. It looks more like a general cache config register.
My conclusion is, that it's impossible to make use of the minicache. In our game this would give a huge speedup. we use palettized textures to be cache friendly. Accessing the palettes and the stack through the mini-cache would give a huge boost.
We might be even able to hack the descriptor-table, but noone knows how the CE-memorymanger behaves afterwards. (heck we can't even disassemble the OS 'cause the dll's aren't readable. They just have execute rights).
It is quite distressing I agree. Once I get a little time free from school, I'm going to try working with the page tables. (Dare I say ouch.. I just deleted all my files.) From what I can tell, the base address of the page table is held in a coprocessor register, so it should just be a matter of mapping the page table a virtual address for your process, changing the settings of your pages, then somehow refreshing the translation lookaside buffer. Ha, easier said then done.