mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:57:47 +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
|
@ -176,21 +176,21 @@ public:
|
|||
{
|
||||
if (a32)
|
||||
return esi();
|
||||
return { si().value(), (u32)si().shadow() & 0xffff };
|
||||
return { si().value(), (u32)si().shadow_as_value() & 0xffff };
|
||||
}
|
||||
|
||||
ValueWithShadow<u32> destination_index(bool a32) const
|
||||
{
|
||||
if (a32)
|
||||
return edi();
|
||||
return { di().value(), (u32)di().shadow() & 0xffff };
|
||||
return { di().value(), (u32)di().shadow_as_value() & 0xffff };
|
||||
}
|
||||
|
||||
ValueWithShadow<u32> loop_index(bool a32) const
|
||||
{
|
||||
if (a32)
|
||||
return ecx();
|
||||
return { cx().value(), (u32)cx().shadow() & 0xffff };
|
||||
return { cx().value(), (u32)cx().shadow_as_value() & 0xffff };
|
||||
}
|
||||
|
||||
bool decrement_loop_index(bool a32)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue