From 56672b8c9809d8f5585d208f5b85549bc3fe2a0e Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Sun, 12 Jan 2020 17:04:15 +0100 Subject: core/memory: Create a special MapMemoryRegion for physical memory. This allows us to create a fastmem arena within the memory.cpp helpers. --- src/core/memory.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/core/memory.h') 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 { @@ -65,6 +66,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. * -- cgit v1.2.3