mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 12:39:13 +12:00
Memory: Implement Unmap in ControlMemory
Also do a sanity check to make sure the memory region is free for linear allocations
This commit is contained in:
parent
c65b91e6f1
commit
ba25ae7eba
2 changed files with 10 additions and 0 deletions
|
@ -426,6 +426,9 @@ bool Memory::allocMemoryLinear(u32& outVaddr, u32 inVaddr, s32 pages, FcramRegio
|
|||
|
||||
u32 paddr = memList.begin()->paddr;
|
||||
u32 vaddr = getLinearHeapVaddr() + paddr;
|
||||
auto res = testMemoryState(vaddr, pages, MemoryState::Free);
|
||||
if (res.isFailure()) Helpers::panic("Unable to map linear allocation (vaddr:%08X pages:%08X)", vaddr, pages);
|
||||
|
||||
Operation op{ .newState = MemoryState::Continuous, .r = r, .w = w, .x = x, .changeState = true, .changePerms = true };
|
||||
changeMemoryState(vaddr, pages, op);
|
||||
mapPhysicalMemory(vaddr, paddr, pages, r, w, x);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue