mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:27:45 +00:00
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:
parent
e08cf8f554
commit
f6e82a8e0a
7 changed files with 115 additions and 101 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "MmapRegion.h"
|
||||
#include "Emulator.h"
|
||||
#include <AK/ByteReader.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
|
@ -196,7 +197,7 @@ void MmapRegion::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 MmapRegion::write16(u32 offset, ValueWithShadow<u16> value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue