aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/memory.h
diff options
context:
space:
mode:
authorMarkus Wick <[email protected]>2020-01-12 17:04:15 +0100
committerMarkus Wick <[email protected]>2020-01-18 08:38:47 +0100
commit56672b8c9809d8f5585d208f5b85549bc3fe2a0e (patch)
tree9ac5f757fb4dbb26272c2b169e0a33bc6164d4e9 /src/core/memory.h
parent55103da066ce7cde79d1872cb3b5058565621ef3 (diff)
downloadyuzu-mainline-56672b8c9809d8f5585d208f5b85549bc3fe2a0e.tar.gz
yuzu-mainline-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.h16
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;
}
namespace Kernel {
+class PhysicalMemory;
class Process;
-}
+} // namespace Kernel
namespace Memory {
@@ -66,6 +67,19 @@ public:
void SetCurrentPageTable(Kernel::Process& process);
/**
+ * Maps an physical buffer onto a region of the emulated process address space.
+ *
+ * @param page_table The page table of the emulated process.
+ * @param base The address to start mapping at. Must be page-aligned.
+ * @param size The amount of bytes to map. Must be page-aligned.
+ * @param memory Physical buffer with the memory backing the mapping. Must be of length
+ * at least `size + offset`.
+ * @param offset The offset within the physical memory. Must be page-aligned.
+ */
+ void MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size,
+ Kernel::PhysicalMemory& memory, VAddr offset);
+
+ /**
* Maps an allocated buffer onto a region of the emulated process address space.
*
* @param page_table The page table of the emulated process.