aarch64/mem: Introduce a dedicated guest memory access layer

This commit introduces a proper abstraction layer for all read and write
operations.

The previous approach of directly calculating a Host Virtual Address
(HVA) from a Guest Physical Address (GPA) via gpa_to_hva() forces every
part of the emulator that touches guest memory to be aware of the
underlying host pointer, which is poor design.

This new layer introduces a suite of guest_mem_read{b,w,l,q} and
guest_mem_write{b,w,l,q} fuctions. All future memory accesses from the
emulated CPU should be performed through these functions.

The code has also been moved into the pound::aarch64 namespace for
better organization.

Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
Ronald Caesar 2025-08-14 19:56:21 -04:00
parent c550b00dde
commit e7b5349980
5 changed files with 286 additions and 24 deletions

View file

@ -68,6 +68,7 @@ bool ParseFilterRule(Filter &instance, Iterator begin, Iterator end) {
CLS(System) \
CLS(Render) \
CLS(ARM) \
CLS(Memory) \
// GetClassName is a macro defined by Windows.h, grrr...
const char* GetLogClassName(Class logClass) {

View file

@ -34,6 +34,7 @@ enum class Class : const u8 {
System, // Base System messages
Render, // OpenGL and Window messages
ARM,
Memory,
Count // Total number of logging classes
};