UnitTests: Add PageTableHostMappingTest

This commit is contained in:
JosJuice
2026-02-04 21:35:22 +01:00
parent 94283c9639
commit 35ce08fb88
7 changed files with 949 additions and 18 deletions
+16
View File
@@ -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*);
+2
View File
@@ -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; }