diff options
| author | 2020-01-12 17:04:15 +0100 | |
|---|---|---|
| committer | 2020-01-18 08:38:47 +0100 | |
| commit | 56672b8c9809d8f5585d208f5b85549bc3fe2a0e (patch) | |
| tree | 9ac5f757fb4dbb26272c2b169e0a33bc6164d4e9 /src/core/memory.h | |
| parent | core/hle: Simplify PhysicalMemory usage in vm_manager. (diff) | |
| download | yuzu-56672b8c9809d8f5585d208f5b85549bc3fe2a0e.tar.gz yuzu-56672b8c9809d8f5585d208f5b85549bc3fe2a0e.tar.xz yuzu-56672b8c9809d8f5585d208f5b85549bc3fe2a0e.zip | |
core/memory: Create a special MapMemoryRegion for physical memory.
This allows us to create a fastmem arena within the memory.cpp helpers.
Diffstat (limited to 'src/core/memory.h')
| -rw-r--r-- | src/core/memory.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/memory.h b/src/core/memory.h index 1428a6d60..8913a9da4 100644 --- a/src/core/memory.h +++ b/src/core/memory.h | |||
| @@ -19,8 +19,9 @@ class System; | |||
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | namespace Kernel { | 21 | namespace Kernel { |
| 22 | class PhysicalMemory; | ||
| 22 | class Process; | 23 | class Process; |
| 23 | } | 24 | } // namespace Kernel |
| 24 | 25 | ||
| 25 | namespace Memory { | 26 | namespace Memory { |
| 26 | 27 | ||
| @@ -66,6 +67,19 @@ public: | |||
| 66 | void SetCurrentPageTable(Kernel::Process& process); | 67 | void SetCurrentPageTable(Kernel::Process& process); |
| 67 | 68 | ||
| 68 | /** | 69 | /** |
| 70 | * Maps an physical buffer onto a region of the emulated process address space. | ||
| 71 | * | ||
| 72 | * @param page_table The page table of the emulated process. | ||
| 73 | * @param base The address to start mapping at. Must be page-aligned. | ||
| 74 | * @param size The amount of bytes to map. Must be page-aligned. | ||
| 75 | * @param memory Physical buffer with the memory backing the mapping. Must be of length | ||
| 76 | * at least `size + offset`. | ||
| 77 | * @param offset The offset within the physical memory. Must be page-aligned. | ||
| 78 | */ | ||
| 79 | void MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, | ||
| 80 | Kernel::PhysicalMemory& memory, VAddr offset); | ||
| 81 | |||
| 82 | /** | ||
| 69 | * Maps an allocated buffer onto a region of the emulated process address space. | 83 | * Maps an allocated buffer onto a region of the emulated process address space. |
| 70 | * | 84 | * |
| 71 | * @param page_table The page table of the emulated process. | 85 | * @param page_table The page table of the emulated process. |