Core: Refactor direct memory handling (#3645)

* Refactor direct memory areas

At this point, swapping the multiple booleans for an enum is cleaner, and makes it easier to track the state of a direct memory area.

I've also sped up the logic for mapping direct memory by checking for out-of-bounds physical addresses before looping, and made the logic more solid using my dma type logic.

* Fix PoolCommit assert

Windows devices will throw an access violation if we don't check for iterator reaching end.
This commit is contained in:
Stephen Miller
2025-09-23 14:42:15 -05:00
committed by GitHub
parent 1eead6a5ee
commit 5d8027f0c0
3 changed files with 66 additions and 35 deletions

View File

@@ -44,7 +44,7 @@ bool MemoryMapViewer::Iterator::DrawLine() {
return false;
}
auto m = dmem.it->second;
if (m.is_free) {
if (m.dma_type == DMAType::Free) {
++dmem.it;
return DrawLine();
}
@@ -56,7 +56,7 @@ bool MemoryMapViewer::Iterator::DrawLine() {
auto type = static_cast<::Libraries::Kernel::MemoryTypes>(m.memory_type);
Text("%s", magic_enum::enum_name(type).data());
TableNextColumn();
Text("%d", m.is_pooled);
Text("%d", m.dma_type == DMAType::Pooled || m.dma_type == DMAType::Committed);
++dmem.it;
return true;
}