UserspaceEmulator: Make it possible to wrap PODs in ValueWithShadow

Instead of making it hold the shadow data as another `T`, make it hold
the data as a byte array, and allow it to read the byte array as `T`.
This makes it much easier to make a "read_typed" function in the MMU.
This commit is contained in:
Ali Mohammad Pur
2022-02-27 23:56:46 +03:30
committed by Andreas Kling
parent e08cf8f554
commit f6e82a8e0a
Notes: sideshowbarker 2024-07-17 17:56:54 +09:00
7 changed files with 115 additions and 101 deletions

View File

@@ -85,7 +85,7 @@ void SimpleRegion::write8(u32 offset, ValueWithShadow<u8> value)
{
VERIFY(offset < size());
m_data[offset] = value.value();
m_shadow_data[offset] = value.shadow();
m_shadow_data[offset] = value.shadow()[0];
}
void SimpleRegion::write16(u32 offset, ValueWithShadow<u16> value)