diff options
| author | JosJuice <josjuice@gmail.com> | 2026-01-03 20:05:36 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2026-02-04 21:35:22 +0100 |
| commit | 35ce08fb888036de48b220ee4d3b2dab5cf65a0f (patch) | |
| tree | 07c1801e839cb3cbafbf93ea418af892decacb07 /Source/Core | |
| parent | 94283c963993336826b141bb367ad54ff2f00507 (diff) | |
UnitTests: Add PageTableHostMappingTest
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Common/Swap.h | 16 | ||||
| -rw-r--r-- | Source/Core/Core/HW/Memmap.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/Source/Core/Common/Swap.h b/Source/Core/Common/Swap.h index 965d1aabc2..bf9b7d472b 100644 --- a/Source/Core/Common/Swap.h +++ b/Source/Core/Common/Swap.h @@ -127,6 +127,22 @@ inline u64 swap64(const u8* data) return swap64(value); } +inline void WriteSwap16(u8* data, u16 value) +{ + value = swap16(value); + std::memcpy(data, &value, sizeof(u16)); +} +inline void WriteSwap32(u8* data, u32 value) +{ + value = swap32(value); + std::memcpy(data, &value, sizeof(u32)); +} +inline void WriteSwap64(u8* data, u64 value) +{ + value = swap64(value); + std::memcpy(data, &value, sizeof(u64)); +} + template <int count> void swap(u8*); diff --git a/Source/Core/Core/HW/Memmap.h b/Source/Core/Core/HW/Memmap.h index 8779be8210..ce45d73034 100644 --- a/Source/Core/Core/HW/Memmap.h +++ b/Source/Core/Core/HW/Memmap.h @@ -85,6 +85,8 @@ public: u8* GetPhysicalPageMappingsBase() const { return m_physical_page_mappings_base; } u8* GetLogicalPageMappingsBase() const { return m_logical_page_mappings_base; } + u32 GetHostPageSize() const { return m_page_size; } + // FIXME: these should not return their address, but AddressSpace wants that u8*& GetRAM() { return m_ram; } u8*& GetEXRAM() { return m_exram; } |
