ReXGlue SDK
Loading...
Searching...
No Matches
rex::IPhysicalMemory Class Referenceabstract

#include <rex/guest.h>

Public Member Functions

virtual Result< void > CopyFromPhysical (u32 address, std::span< std::byte > out)=0
virtual Result< void > CopyToPhysical (u32 address, std::span< const std::byte > data)=0
virtual Result< std::span< const std::byte > > GetReadOnlyPhysicalSpan (PhysicalRange range)=0
virtual Result< std::span< std::byte > > GetWritablePhysicalSpan (PhysicalRange range)=0
virtual Result< void > StoreRelease32 (u32 address, u32 value)=0
virtual Result< u32 > LoadAcquire32 (u32 address)=0

Detailed Description

Guest physical memory. Each call fails only for a range outside the 512 MiB of physical memory. It does not check mapping or protection.

Member Function Documentation

◆ CopyFromPhysical()

virtual Result< void > rex::IPhysicalMemory::CopyFromPhysical ( u32 address,
std::span< std::byte > out )
nodiscardpure virtual

Copies guest physical memory into a buffer.

Parameters
outThe destination, sized to the length.
Returns
Ok, or an error when the range is outside physical memory.

◆ CopyToPhysical()

virtual Result< void > rex::IPhysicalMemory::CopyToPhysical ( u32 address,
std::span< const std::byte > data )
nodiscardpure virtual

Copies a buffer into guest physical memory and notifies the listeners of watched pages.

Parameters
dataThe bytes to copy.
Returns
Ok, or an error when the range is outside physical memory.

◆ GetReadOnlyPhysicalSpan()

virtual Result< std::span< const std::byte > > rex::IPhysicalMemory::GetReadOnlyPhysicalSpan ( PhysicalRange range)
nodiscardpure virtual

Returns a read only view of guest physical memory, or an error when the range is outside it.

◆ GetWritablePhysicalSpan()

virtual Result< std::span< std::byte > > rex::IPhysicalMemory::GetWritablePhysicalSpan ( PhysicalRange range)
nodiscardpure virtual

Returns a writable view of guest physical memory, or an error when the range is outside it. Writes through it do not notify listeners.

◆ LoadAcquire32()

virtual Result< u32 > rex::IPhysicalMemory::LoadAcquire32 ( u32 address)
nodiscardpure virtual

Reads a big endian u32 with acquire ordering.

Parameters
addressThe 4 byte aligned address.
Returns
The value, or an error when the address is outside physical memory.

◆ StoreRelease32()

virtual Result< void > rex::IPhysicalMemory::StoreRelease32 ( u32 address,
u32 value )
nodiscardpure virtual

Writes a big endian u32 with release ordering, for GPU fences.

Parameters
addressThe 4 byte aligned address.
Returns
Ok, or an error when the address is outside physical memory.

The documentation for this class was generated from the following file: