mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02: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:
committed by
Andreas Kling
parent
e08cf8f554
commit
f6e82a8e0a
Notes:
sideshowbarker
2024-07-17 17:56:54 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/f6e82a8e0a Pull-request: https://github.com/SerenityOS/serenity/pull/12762
@@ -347,7 +347,7 @@ bool SoftMMU::fast_fill_memory8(X86::LogicalAddress address, size_t size, ValueW
|
||||
|
||||
size_t offset_in_region = address.offset() - region->base();
|
||||
memset(region->data() + offset_in_region, value.value(), size);
|
||||
memset(region->shadow_data() + offset_in_region, value.shadow(), size);
|
||||
memset(region->shadow_data() + offset_in_region, value.shadow()[0], size);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ bool SoftMMU::fast_fill_memory32(X86::LogicalAddress address, size_t count, Valu
|
||||
|
||||
size_t offset_in_region = address.offset() - region->base();
|
||||
fast_u32_fill((u32*)(region->data() + offset_in_region), value.value(), count);
|
||||
fast_u32_fill((u32*)(region->shadow_data() + offset_in_region), value.shadow(), count);
|
||||
fast_u32_fill((u32*)(region->shadow_data() + offset_in_region), value.shadow_as_value(), count);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user