From 4c2ed2706e3579ec1304907dad0d45673768e1fc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Nov 2019 12:33:20 -0500 Subject: core/memory: Introduce skeleton of Memory class Currently, the main memory management code is one of the remaining places where we have global state. The next series of changes will aim to rectify this. This change simply introduces the main skeleton of the class that will contain all the necessary state. --- src/core/memory.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index 09008e1dd..c690df3c3 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -8,6 +8,10 @@ #include #include "common/common_types.h" +namespace Core { +class System; +} + namespace Kernel { class Process; } @@ -36,6 +40,23 @@ enum : VAddr { KERNEL_REGION_END = KERNEL_REGION_VADDR + KERNEL_REGION_SIZE, }; +/// Central class that handles all memory operations and state. +class Memory { +public: + explicit Memory(Core::System& system); + ~Memory(); + + Memory(const Memory&) = delete; + Memory& operator=(const Memory&) = delete; + + Memory(Memory&&) = default; + Memory& operator=(Memory&&) = default; + +private: + struct Impl; + std::unique_ptr impl; +}; + /// Changes the currently active page table to that of /// the given process instance. void SetCurrentPageTable(Kernel::Process& process); -- cgit v1.2.3 From 323680e5ad3ca0e27f2dd1de26816741b3243bed Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Nov 2019 13:09:12 -0500 Subject: core/memory: Migrate over memory mapping functions to the new Memory class Migrates all of the direct mapping facilities over to the new memory class. In the process, this also obsoletes the need for memory_setup.h, so we can remove it entirely from the project. --- src/core/memory.h | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index c690df3c3..87ed3b696 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -5,8 +5,14 @@ #pragma once #include +#include #include #include "common/common_types.h" +#include "common/memory_hook.h" + +namespace Common { +struct PageTable; +} namespace Core { class System; @@ -52,6 +58,59 @@ public: Memory(Memory&&) = default; Memory& operator=(Memory&&) = default; + /** + * Maps an allocated 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 target Buffer with the memory backing the mapping. Must be of length at least + * `size`. + */ + void MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, u8* target); + + /** + * Maps a region of the emulated process address space as a IO region. + * + * @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 mmio_handler The handler that backs the mapping. + */ + void MapIoRegion(Common::PageTable& page_table, VAddr base, u64 size, + Common::MemoryHookPointer mmio_handler); + + /** + * Unmaps a region of the emulated process address space. + * + * @param page_table The page table of the emulated process. + * @param base The address to begin unmapping at. + * @param size The amount of bytes to unmap. + */ + void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size); + + /** + * Adds a memory hook to intercept reads and writes to given region of memory. + * + * @param page_table The page table of the emulated process + * @param base The starting address to apply the hook to. + * @param size The size of the memory region to apply the hook to, in bytes. + * @param hook The hook to apply to the region of memory. + */ + void AddDebugHook(Common::PageTable& page_table, VAddr base, u64 size, + Common::MemoryHookPointer hook); + + /** + * Removes a memory hook from a given range of memory. + * + * @param page_table The page table of the emulated process. + * @param base The starting address to remove the hook from. + * @param size The size of the memory region to remove the hook from, in bytes. + * @param hook The hook to remove from the specified region of memory. + */ + void RemoveDebugHook(Common::PageTable& page_table, VAddr base, u64 size, + Common::MemoryHookPointer hook); + private: struct Impl; std::unique_ptr impl; -- cgit v1.2.3 From e58748fd802dc069e90928d12d4db9ff994a869d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Nov 2019 13:46:41 -0500 Subject: core/memory: Migrate over address checking functions to the new Memory class A fairly straightforward migration. These member functions can just be mostly moved verbatim with minor changes. We already have the necessary plumbing in places that they're used. IsKernelVirtualAddress() can remain a non-member function, since it doesn't rely on class state in any form. --- src/core/memory.h | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index 87ed3b696..cacf4fb1a 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -111,6 +111,27 @@ public: void RemoveDebugHook(Common::PageTable& page_table, VAddr base, u64 size, Common::MemoryHookPointer hook); + /** + * Checks whether or not the supplied address is a valid virtual + * address for the given process. + * + * @param process The emulated process to check the address against. + * @param vaddr The virtual address to check the validity of. + * + * @returns True if the given virtual address is valid, false otherwise. + */ + bool IsValidVirtualAddress(const Kernel::Process& process, VAddr vaddr) const; + + /** + * Checks whether or not the supplied address is a valid virtual + * address for the current process. + * + * @param vaddr The virtual address to check the validity of. + * + * @returns True if the given virtual address is valid, false otherwise. + */ + bool IsValidVirtualAddress(VAddr vaddr) const; + private: struct Impl; std::unique_ptr impl; @@ -120,9 +141,6 @@ private: /// the given process instance. void SetCurrentPageTable(Kernel::Process& process); -/// Determines if the given VAddr is valid for the specified process. -bool IsValidVirtualAddress(const Kernel::Process& process, VAddr vaddr); -bool IsValidVirtualAddress(VAddr vaddr); /// Determines if the given VAddr is a kernel address bool IsKernelVirtualAddress(VAddr vaddr); -- cgit v1.2.3 From 3f08e8d8d4ef16cf2468620fbfbdac46e43dcaef Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Nov 2019 15:19:15 -0500 Subject: core/memory: Migrate over GetPointer() With all of the interfaces ready for migration, it's trivial to migrate over GetPointer(). --- src/core/memory.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index cacf4fb1a..59b9ce2bb 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -132,6 +132,26 @@ public: */ bool IsValidVirtualAddress(VAddr vaddr) const; + /** + * Gets a pointer to the given address. + * + * @param vaddr Virtual address to retrieve a pointer to. + * + * @returns The pointer to the given address, if the address is valid. + * If the address is not valid, nullptr will be returned. + */ + u8* GetPointer(VAddr vaddr); + + /** + * Gets a pointer to the given address. + * + * @param vaddr Virtual address to retrieve a pointer to. + * + * @returns The pointer to the given address, if the address is valid. + * If the address is not valid, nullptr will be returned. + */ + const u8* GetPointer(VAddr vaddr) const; + private: struct Impl; std::unique_ptr impl; @@ -162,8 +182,6 @@ void WriteBlock(VAddr dest_addr, const void* src_buffer, std::size_t size); void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size); void CopyBlock(VAddr dest_addr, VAddr src_addr, std::size_t size); -u8* GetPointer(VAddr vaddr); - std::string ReadCString(VAddr vaddr, std::size_t max_length); /** -- cgit v1.2.3 From b2165c6b353be5e8117d1f9bc677bb198fa9d8cd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Nov 2019 15:48:19 -0500 Subject: core/memory: Migrate over ReadCString() to the Memory class This only had one usage spot, so this is fairly straightforward to convert over. --- src/core/memory.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index 59b9ce2bb..47765c8a0 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -152,6 +152,23 @@ public: */ const u8* GetPointer(VAddr vaddr) const; + /** + * Reads a null-terminated string from the given virtual address. + * This function will continually read characters until either: + * + * - A null character ('\0') is reached. + * - max_length characters have been read. + * + * @note The final null-terminating character (if found) is not included + * in the returned string. + * + * @param vaddr The address to begin reading the string from. + * @param max_length The maximum length of the string to read in characters. + * + * @returns The read string. + */ + std::string ReadCString(VAddr vaddr, std::size_t max_length); + private: struct Impl; std::unique_ptr impl; @@ -182,8 +199,6 @@ void WriteBlock(VAddr dest_addr, const void* src_buffer, std::size_t size); void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size); void CopyBlock(VAddr dest_addr, VAddr src_addr, std::size_t size); -std::string ReadCString(VAddr vaddr, std::size_t max_length); - /** * Mark each page touching the region as cached. */ -- cgit v1.2.3 From 849581075a230ad0f5419bb5d5e1f9e48e6cfd8a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Nov 2019 15:56:13 -0500 Subject: core/memory: Migrate over RasterizerMarkRegionCached() to the Memory class This is only used within the accelerated rasterizer in two places, so this is also a very trivial migration. --- src/core/memory.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index 47765c8a0..7cd348b49 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -169,6 +169,16 @@ public: */ std::string ReadCString(VAddr vaddr, std::size_t max_length); + /** + * Marks each page within the specified address range as cached or uncached. + * + * @param vaddr The virtual address indicating the start of the address range. + * @param size The size of the address range in bytes. + * @param cached Whether or not any pages within the address range should be + * marked as cached or uncached. + */ + void RasterizerMarkRegionCached(VAddr vaddr, u64 size, bool cached); + private: struct Impl; std::unique_ptr impl; @@ -199,9 +209,4 @@ void WriteBlock(VAddr dest_addr, const void* src_buffer, std::size_t size); void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size); void CopyBlock(VAddr dest_addr, VAddr src_addr, std::size_t size); -/** - * Mark each page touching the region as cached. - */ -void RasterizerMarkRegionCached(VAddr vaddr, u64 size, bool cached); - } // namespace Memory -- cgit v1.2.3 From 89ef3ef5752e42d0eb0bdfa23cc72d391db74216 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Nov 2019 16:06:49 -0500 Subject: core/memory: Migrate over ZeroBlock() and CopyBlock() to the Memory class These currently aren't used anywhere in the codebase, so these are very trivial to move over to the Memory class. --- src/core/memory.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index 7cd348b49..fc0013a96 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -169,6 +169,57 @@ public: */ std::string ReadCString(VAddr vaddr, std::size_t max_length); + /** + * Fills the specified address range within a process' address space with zeroes. + * + * @param process The process that will have a portion of its memory zeroed out. + * @param dest_addr The starting virtual address of the range to zero out. + * @param size The size of the address range to zero out, in bytes. + * + * @post The range [dest_addr, size) within the process' address space is + * filled with zeroes. + */ + void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size); + + /** + * Fills the specified address range within the current process' address space with zeroes. + * + * @param dest_addr The starting virtual address of the range to zero out. + * @param size The size of the address range to zero out, in bytes. + * + * @post The range [dest_addr, size) within the current process' address space is + * filled with zeroes. + */ + void ZeroBlock(VAddr dest_addr, std::size_t size); + + /** + * Copies data within a process' address space to another location within the + * same address space. + * + * @param process The process that will have data copied within its address space. + * @param dest_addr The destination virtual address to begin copying the data into. + * @param src_addr The source virtual address to begin copying the data from. + * @param size The size of the data to copy, in bytes. + * + * @post The range [dest_addr, size) within the process' address space contains the + * same data within the range [src_addr, size). + */ + void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr, + std::size_t size); + + /** + * Copies data within the current process' address space to another location within the + * same address space. + * + * @param dest_addr The destination virtual address to begin copying the data into. + * @param src_addr The source virtual address to begin copying the data from. + * @param size The size of the data to copy, in bytes. + * + * @post The range [dest_addr, size) within the current process' address space + * contains the same data within the range [src_addr, size). + */ + void CopyBlock(VAddr dest_addr, VAddr src_addr, std::size_t size); + /** * Marks each page within the specified address range as cached or uncached. * @@ -206,7 +257,5 @@ void ReadBlock(VAddr src_addr, void* dest_buffer, std::size_t size); void WriteBlock(const Kernel::Process& process, VAddr dest_addr, const void* src_buffer, std::size_t size); void WriteBlock(VAddr dest_addr, const void* src_buffer, std::size_t size); -void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size); -void CopyBlock(VAddr dest_addr, VAddr src_addr, std::size_t size); } // namespace Memory -- cgit v1.2.3 From b05bfc603689419dc515a656b9fc711d79994f13 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Nov 2019 16:29:34 -0500 Subject: core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory class With all of the trivial parts of the memory interface moved over, we can get right into moving over the bits that are used. Note that this does require the use of GetInstance from the global system instance to be used within hle_ipc.cpp and the gdbstub. This is fine for the time being, as they both already rely on the global system instance in other functions. These will be removed in a change directed at both of these respectively. For now, it's sufficient, as it still accomplishes the goal of de-globalizing the memory code. --- src/core/memory.h | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 78 insertions(+), 7 deletions(-) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index fc0013a96..cc6ab920e 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -152,6 +152,46 @@ public: */ const u8* GetPointer(VAddr vaddr) const; + /** + * Reads an 8-bit unsigned value from the current process' address space + * at the given virtual address. + * + * @param addr The virtual address to read the 8-bit value from. + * + * @returns the read 8-bit unsigned value. + */ + u8 Read8(VAddr addr); + + /** + * Reads a 16-bit unsigned value from the current process' address space + * at the given virtual address. + * + * @param addr The virtual address to read the 16-bit value from. + * + * @returns the read 16-bit unsigned value. + */ + u16 Read16(VAddr addr); + + /** + * Reads a 32-bit unsigned value from the current process' address space + * at the given virtual address. + * + * @param addr The virtual address to read the 32-bit value from. + * + * @returns the read 32-bit unsigned value. + */ + u32 Read32(VAddr addr); + + /** + * Reads a 64-bit unsigned value from the current process' address space + * at the given virtual address. + * + * @param addr The virtual address to read the 64-bit value from. + * + * @returns the read 64-bit value. + */ + u64 Read64(VAddr addr); + /** * Reads a null-terminated string from the given virtual address. * This function will continually read characters until either: @@ -169,6 +209,44 @@ public: */ std::string ReadCString(VAddr vaddr, std::size_t max_length); + /** + * Reads a contiguous block of bytes from a specified process' address space. + * + * @param process The process to read the data from. + * @param src_addr The virtual address to begin reading from. + * @param dest_buffer The buffer to place the read bytes into. + * @param size The amount of data to read, in bytes. + * + * @note If a size of 0 is specified, then this function reads nothing and + * no attempts to access memory are made at all. + * + * @pre dest_buffer must be at least size bytes in length, otherwise a + * buffer overrun will occur. + * + * @post The range [dest_buffer, size) contains the read bytes from the + * process' address space. + */ + void ReadBlock(const Kernel::Process& process, VAddr src_addr, void* dest_buffer, + std::size_t size); + + /** + * Reads a contiguous block of bytes from the current process' address space. + * + * @param src_addr The virtual address to begin reading from. + * @param dest_buffer The buffer to place the read bytes into. + * @param size The amount of data to read, in bytes. + * + * @note If a size of 0 is specified, then this function reads nothing and + * no attempts to access memory are made at all. + * + * @pre dest_buffer must be at least size bytes in length, otherwise a + * buffer overrun will occur. + * + * @post The range [dest_buffer, size) contains the read bytes from the + * current process' address space. + */ + void ReadBlock(VAddr src_addr, void* dest_buffer, std::size_t size); + /** * Fills the specified address range within a process' address space with zeroes. * @@ -242,18 +320,11 @@ void SetCurrentPageTable(Kernel::Process& process); /// Determines if the given VAddr is a kernel address bool IsKernelVirtualAddress(VAddr vaddr); -u8 Read8(VAddr addr); -u16 Read16(VAddr addr); -u32 Read32(VAddr addr); -u64 Read64(VAddr addr); - void Write8(VAddr addr, u8 data); void Write16(VAddr addr, u16 data); void Write32(VAddr addr, u32 data); void Write64(VAddr addr, u64 data); -void ReadBlock(const Kernel::Process& process, VAddr src_addr, void* dest_buffer, std::size_t size); -void ReadBlock(VAddr src_addr, void* dest_buffer, std::size_t size); void WriteBlock(const Kernel::Process& process, VAddr dest_addr, const void* src_buffer, std::size_t size); void WriteBlock(VAddr dest_addr, const void* src_buffer, std::size_t size); -- cgit v1.2.3 From e4c381b8850db96f162cfcf2cbe28b0e7c1f76f1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Nov 2019 17:39:57 -0500 Subject: core/memory: Migrate over Write{8, 16, 32, 64, Block} to the Memory class The Write functions are used slightly less than the Read functions, which make these a bit nicer to move over. The only adjustments we really need to make here are to Dynarmic's exclusive monitor instance. We need to keep a reference to the currently active memory instance to perform exclusive read/write operations. --- src/core/memory.h | 97 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 88 insertions(+), 9 deletions(-) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index cc6ab920e..7878f3fb1 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -192,6 +192,50 @@ public: */ u64 Read64(VAddr addr); + /** + * Writes an 8-bit unsigned integer to the given virtual address in + * the current process' address space. + * + * @param addr The virtual address to write the 8-bit unsigned integer to. + * @param data The 8-bit unsigned integer to write to the given virtual address. + * + * @post The memory at the given virtual address contains the specified data value. + */ + void Write8(VAddr addr, u8 data); + + /** + * Writes a 16-bit unsigned integer to the given virtual address in + * the current process' address space. + * + * @param addr The virtual address to write the 16-bit unsigned integer to. + * @param data The 16-bit unsigned integer to write to the given virtual address. + * + * @post The memory range [addr, sizeof(data)) contains the given data value. + */ + void Write16(VAddr addr, u16 data); + + /** + * Writes a 32-bit unsigned integer to the given virtual address in + * the current process' address space. + * + * @param addr The virtual address to write the 32-bit unsigned integer to. + * @param data The 32-bit unsigned integer to write to the given virtual address. + * + * @post The memory range [addr, sizeof(data)) contains the given data value. + */ + void Write32(VAddr addr, u32 data); + + /** + * Writes a 64-bit unsigned integer to the given virtual address in + * the current process' address space. + * + * @param addr The virtual address to write the 64-bit unsigned integer to. + * @param data The 64-bit unsigned integer to write to the given virtual address. + * + * @post The memory range [addr, sizeof(data)) contains the given data value. + */ + void Write64(VAddr addr, u64 data); + /** * Reads a null-terminated string from the given virtual address. * This function will continually read characters until either: @@ -247,6 +291,50 @@ public: */ void ReadBlock(VAddr src_addr, void* dest_buffer, std::size_t size); + /** + * Writes a range of bytes into a given process' address space at the specified + * virtual address. + * + * @param process The process to write data into the address space of. + * @param dest_addr The destination virtual address to begin writing the data at. + * @param src_buffer The data to write into the process' address space. + * @param size The size of the data to write, in bytes. + * + * @post The address range [dest_addr, size) in the process' address space + * contains the data that was within src_buffer. + * + * @post If an attempt is made to write into an unmapped region of memory, the writes + * will be ignored and an error will be logged. + * + * @post If a write is performed into a region of memory that is considered cached + * rasterizer memory, will cause the currently active rasterizer to be notified + * and will mark that region as invalidated to caches that the active + * graphics backend may be maintaining over the course of execution. + */ + void WriteBlock(const Kernel::Process& process, VAddr dest_addr, const void* src_buffer, + std::size_t size); + + /** + * Writes a range of bytes into the current process' address space at the specified + * virtual address. + * + * @param dest_addr The destination virtual address to begin writing the data at. + * @param src_buffer The data to write into the current process' address space. + * @param size The size of the data to write, in bytes. + * + * @post The address range [dest_addr, size) in the current process' address space + * contains the data that was within src_buffer. + * + * @post If an attempt is made to write into an unmapped region of memory, the writes + * will be ignored and an error will be logged. + * + * @post If a write is performed into a region of memory that is considered cached + * rasterizer memory, will cause the currently active rasterizer to be notified + * and will mark that region as invalidated to caches that the active + * graphics backend may be maintaining over the course of execution. + */ + void WriteBlock(VAddr dest_addr, const void* src_buffer, std::size_t size); + /** * Fills the specified address range within a process' address space with zeroes. * @@ -320,13 +408,4 @@ void SetCurrentPageTable(Kernel::Process& process); /// Determines if the given VAddr is a kernel address bool IsKernelVirtualAddress(VAddr vaddr); -void Write8(VAddr addr, u8 data); -void Write16(VAddr addr, u16 data); -void Write32(VAddr addr, u32 data); -void Write64(VAddr addr, u64 data); - -void WriteBlock(const Kernel::Process& process, VAddr dest_addr, const void* src_buffer, - std::size_t size); -void WriteBlock(VAddr dest_addr, const void* src_buffer, std::size_t size); - } // namespace Memory -- cgit v1.2.3 From e7e939104bb167babec7b5f7d5d8390c85f3cbf4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Nov 2019 18:34:30 -0500 Subject: core/memory; Migrate over SetCurrentPageTable() to the Memory class Now that literally every other API function is converted over to the Memory class, we can just move the file-local page table into the Memory implementation class, finally getting rid of global state within the memory code. --- src/core/memory.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/core/memory.h') diff --git a/src/core/memory.h b/src/core/memory.h index 7878f3fb1..1428a6d60 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -58,6 +58,13 @@ public: Memory(Memory&&) = default; Memory& operator=(Memory&&) = default; + /** + * Changes the currently active page table to that of the given process instance. + * + * @param process The process to use the page table of. + */ + void SetCurrentPageTable(Kernel::Process& process); + /** * Maps an allocated buffer onto a region of the emulated process address space. * @@ -401,10 +408,6 @@ private: std::unique_ptr impl; }; -/// Changes the currently active page table to that of -/// the given process instance. -void SetCurrentPageTable(Kernel::Process& process); - /// Determines if the given VAddr is a kernel address bool IsKernelVirtualAddress(VAddr vaddr); -- cgit v1.2.3