[Memory] Implement APPMEMALLOC

This commit is contained in:
wheremyfoodat 2022-09-21 22:49:22 +03:00
parent db48d08c34
commit 0b2e22ca6d
2 changed files with 8 additions and 2 deletions

View file

@ -5,6 +5,7 @@
namespace ConfigMem {
enum : u32 {
KernelVersionMinor = 0x1FF80002,
KernelVersionMajor = 0x1FF80003
KernelVersionMajor = 0x1FF80003,
AppMemAlloc = 0x1FF80040
};
}

View file

@ -84,7 +84,12 @@ u32 Memory::read32(u32 vaddr) {
if (pointer != 0) [[likely]] {
return *(u32*)(pointer + offset);
} else {
Helpers::panic("Unimplemented 32-bit read, addr: %08X", vaddr);
switch (vaddr) {
case ConfigMem::AppMemAlloc: return appResourceLimits.maxCommit;
default:
Helpers::panic("Unimplemented 32-bit read, addr: %08X", vaddr);
break;
}
}
}