Code: Select all
// main cpu
ClearArea* currentClearArea; // an array of areas to clear
ClearArea* clearAreaEnd = currentClearArea + clearAreasCount; // the end of the array
// on the second cpu
FlushMemory(currentClearArea, clearAreaEnd );
Code: Select all
void FlushMemory(void* start, void* end)
{
// does it have to be aligned on 16 bytes?
u8* runner = (u8*)start; //(u8*)(((u32)start >> 4) << 4);
while (runner < (u8*)end)
{
u8* flushRunner = (u8*)((u32)runner | 0x60000000);
*flushRunner = 2; // write anything?
runner += 16; // skip to the next 16 bytes
}
}
Code: Select all
FlushMemory((ClearArea*)UNCACHE_PTR(currentClearAreas), clearAreaEnd);