mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
UE+LibX86: Support bigger reads and writes
This commit is contained in:
parent
a99812633b
commit
f1957bb86b
Notes:
sideshowbarker
2024-07-18 19:10:23 +09:00
Author: https://github.com/Hendiadyoin1
Commit: f1957bb86b
Pull-request: https://github.com/SerenityOS/serenity/pull/6225
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bcoles
11 changed files with 316 additions and 4 deletions
|
@ -47,6 +47,18 @@ ValueWithShadow<u64> SimpleRegion::read64(u32 offset)
|
|||
return { *reinterpret_cast<const u64*>(m_data + offset), *reinterpret_cast<const u64*>(m_shadow_data + offset) };
|
||||
}
|
||||
|
||||
ValueWithShadow<u128> SimpleRegion::read128(u32 offset)
|
||||
{
|
||||
VERIFY(offset + 15 < size());
|
||||
return { *reinterpret_cast<const u128*>(m_data + offset), *reinterpret_cast<const u128*>(m_shadow_data + offset) };
|
||||
}
|
||||
|
||||
ValueWithShadow<u256> SimpleRegion::read256(u32 offset)
|
||||
{
|
||||
VERIFY(offset + 31 < size());
|
||||
return { *reinterpret_cast<const u256*>(m_data + offset), *reinterpret_cast<const u256*>(m_shadow_data + offset) };
|
||||
}
|
||||
|
||||
void SimpleRegion::write8(u32 offset, ValueWithShadow<u8> value)
|
||||
{
|
||||
VERIFY(offset < size());
|
||||
|
@ -74,6 +86,18 @@ void SimpleRegion::write64(u32 offset, ValueWithShadow<u64> value)
|
|||
*reinterpret_cast<u64*>(m_data + offset) = value.value();
|
||||
*reinterpret_cast<u64*>(m_shadow_data + offset) = value.shadow();
|
||||
}
|
||||
void SimpleRegion::write128(u32 offset, ValueWithShadow<u128> value)
|
||||
{
|
||||
VERIFY(offset + 15 < size());
|
||||
*reinterpret_cast<u128*>(m_data + offset) = value.value();
|
||||
*reinterpret_cast<u128*>(m_shadow_data + offset) = value.shadow();
|
||||
}
|
||||
void SimpleRegion::write256(u32 offset, ValueWithShadow<u256> value)
|
||||
{
|
||||
VERIFY(offset + 31 < size());
|
||||
*reinterpret_cast<u256*>(m_data + offset) = value.value();
|
||||
*reinterpret_cast<u256*>(m_shadow_data + offset) = value.shadow();
|
||||
}
|
||||
|
||||
u8* SimpleRegion::cacheable_ptr(u32 offset)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue