mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
UserspaceEmulator+LibX86: Add support for 64-bit memory reads and writes (#3584)
This is useful for reading and writing doubles for #3329. It is also useful for emulating 64-bit binaries. MemoryOrRegisterReference assumes that 64-bit values are always memory references since that's enough for fpu support. If we ever want to emulate 64-bit binaries, that part will need minor updating.
This commit is contained in:
parent
1fa5a526e8
commit
f1c0f661f4
12 changed files with 156 additions and 0 deletions
|
@ -52,10 +52,12 @@ public:
|
|||
virtual void write8(u32 offset, ValueWithShadow<u8>) = 0;
|
||||
virtual void write16(u32 offset, ValueWithShadow<u16>) = 0;
|
||||
virtual void write32(u32 offset, ValueWithShadow<u32>) = 0;
|
||||
virtual void write64(u32 offset, ValueWithShadow<u64>) = 0;
|
||||
|
||||
virtual ValueWithShadow<u8> read8(u32 offset) = 0;
|
||||
virtual ValueWithShadow<u16> read16(u32 offset) = 0;
|
||||
virtual ValueWithShadow<u32> read32(u32 offset) = 0;
|
||||
virtual ValueWithShadow<u64> read64(u32 offset) = 0;
|
||||
|
||||
virtual u8* cacheable_ptr([[maybe_unused]] u32 offset) { return nullptr; }
|
||||
virtual bool is_shared_buffer() const { return false; }
|
||||
|
@ -85,10 +87,12 @@ public:
|
|||
ValueWithShadow<u8> read8(X86::LogicalAddress);
|
||||
ValueWithShadow<u16> read16(X86::LogicalAddress);
|
||||
ValueWithShadow<u32> read32(X86::LogicalAddress);
|
||||
ValueWithShadow<u64> read64(X86::LogicalAddress);
|
||||
|
||||
void write8(X86::LogicalAddress, ValueWithShadow<u8>);
|
||||
void write16(X86::LogicalAddress, ValueWithShadow<u16>);
|
||||
void write32(X86::LogicalAddress, ValueWithShadow<u32>);
|
||||
void write64(X86::LogicalAddress, ValueWithShadow<u64>);
|
||||
|
||||
Region* find_region(X86::LogicalAddress);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue