diff options
Diffstat (limited to 'src/core/memory.cpp')
| -rw-r--r-- | src/core/memory.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 3c2a29d9b..f0888327f 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include "common/swap.h" | 14 | #include "common/swap.h" |
| 15 | #include "core/arm/arm_interface.h" | 15 | #include "core/arm/arm_interface.h" |
| 16 | #include "core/core.h" | 16 | #include "core/core.h" |
| 17 | #include "core/hle/kernel/physical_memory.h" | ||
| 17 | #include "core/hle/kernel/process.h" | 18 | #include "core/hle/kernel/process.h" |
| 18 | #include "core/hle/kernel/vm_manager.h" | 19 | #include "core/hle/kernel/vm_manager.h" |
| 19 | #include "core/memory.h" | 20 | #include "core/memory.h" |
| @@ -38,6 +39,11 @@ struct Memory::Impl { | |||
| 38 | system.ArmInterface(3).PageTableChanged(*current_page_table, address_space_width); | 39 | system.ArmInterface(3).PageTableChanged(*current_page_table, address_space_width); |
| 39 | } | 40 | } |
| 40 | 41 | ||
| 42 | void MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, | ||
| 43 | Kernel::PhysicalMemory& memory, VAddr offset) { | ||
| 44 | MapMemoryRegion(page_table, base, size, memory.data() + offset); | ||
| 45 | } | ||
| 46 | |||
| 41 | void MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, u8* target) { | 47 | void MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, u8* target) { |
| 42 | ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: {:016X}", size); | 48 | ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: {:016X}", size); |
| 43 | ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:016X}", base); | 49 | ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:016X}", base); |
| @@ -601,6 +607,11 @@ void Memory::SetCurrentPageTable(Kernel::Process& process) { | |||
| 601 | impl->SetCurrentPageTable(process); | 607 | impl->SetCurrentPageTable(process); |
| 602 | } | 608 | } |
| 603 | 609 | ||
| 610 | void Memory::MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, | ||
| 611 | Kernel::PhysicalMemory& memory, VAddr offset) { | ||
| 612 | impl->MapMemoryRegion(page_table, base, size, memory, offset); | ||
| 613 | } | ||
| 614 | |||
| 604 | void Memory::MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, u8* target) { | 615 | void Memory::MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, u8* target) { |
| 605 | impl->MapMemoryRegion(page_table, base, size, target); | 616 | impl->MapMemoryRegion(page_table, base, size, target); |
| 606 | } | 617 | } |