panda: invalidate cache by default

When writing to memory, related cache-lines should by default be invalidated.

Change-Id: I5477fa86c75d512f483a5b61f147666d3d845ea2
This commit is contained in:
Lars Rademacher
2013-11-25 22:40:05 +01:00
parent 52e5ee8f60
commit 2285427a4c

View File

@ -88,7 +88,7 @@ public:
*/
void setByte(guest_address_t addr, byte_t data)
{
oocdw_write_to_memory(addr, 1, 1, &data, false);
oocdw_write_to_memory(addr, 1, 1, &data, true);
}
/**
@ -101,11 +101,18 @@ public:
*/
void setBytes(guest_address_t addr, size_t cnt, void const *src)
{
// ToDo (PORT): This works, but may be slower than writing a whole block
uint8_t const *s = static_cast<uint8_t const *>(src);
// ToDo: Check Endianess?
oocdw_write_to_memory(addr, 1, cnt, s, false);
// Write in 4-Byte chunks
// ToDo: Correct byte ordering?
if (cnt >= 4) {
oocdw_write_to_memory(addr, 4, cnt / 4, s, true);
}
if ((cnt % 4) != 0) {
oocdw_write_to_memory(addr + (cnt/4) * 4, 1, cnt % 4, s, true);
}
}
};