summaryrefslogtreecommitdiff
path: root/src/core/memory.h
diff options
context:
space:
mode:
authorGravatar Lioncash2019-11-26 13:46:41 -0500
committerGravatar Lioncash2019-11-26 21:53:34 -0500
commite58748fd802dc069e90928d12d4db9ff994a869d (patch)
tree152c306a9a51f0ba49e2a34d1dc0db9eb2923013 /src/core/memory.h
parentcore/memory: Migrate over memory mapping functions to the new Memory class (diff)
downloadyuzu-e58748fd802dc069e90928d12d4db9ff994a869d.tar.gz
yuzu-e58748fd802dc069e90928d12d4db9ff994a869d.tar.xz
yuzu-e58748fd802dc069e90928d12d4db9ff994a869d.zip
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.
Diffstat (limited to 'src/core/memory.h')
-rw-r--r--src/core/memory.h24
1 files changed, 21 insertions, 3 deletions
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:
111 void RemoveDebugHook(Common::PageTable& page_table, VAddr base, u64 size, 111 void RemoveDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
112 Common::MemoryHookPointer hook); 112 Common::MemoryHookPointer hook);
113 113
114 /**
115 * Checks whether or not the supplied address is a valid virtual
116 * address for the given process.
117 *
118 * @param process The emulated process to check the address against.
119 * @param vaddr The virtual address to check the validity of.
120 *
121 * @returns True if the given virtual address is valid, false otherwise.
122 */
123 bool IsValidVirtualAddress(const Kernel::Process& process, VAddr vaddr) const;
124
125 /**
126 * Checks whether or not the supplied address is a valid virtual
127 * address for the current process.
128 *
129 * @param vaddr The virtual address to check the validity of.
130 *
131 * @returns True if the given virtual address is valid, false otherwise.
132 */
133 bool IsValidVirtualAddress(VAddr vaddr) const;
134
114private: 135private:
115 struct Impl; 136 struct Impl;
116 std::unique_ptr<Impl> impl; 137 std::unique_ptr<Impl> impl;
@@ -120,9 +141,6 @@ private:
120/// the given process instance. 141/// the given process instance.
121void SetCurrentPageTable(Kernel::Process& process); 142void SetCurrentPageTable(Kernel::Process& process);
122 143
123/// Determines if the given VAddr is valid for the specified process.
124bool IsValidVirtualAddress(const Kernel::Process& process, VAddr vaddr);
125bool IsValidVirtualAddress(VAddr vaddr);
126/// Determines if the given VAddr is a kernel address 144/// Determines if the given VAddr is a kernel address
127bool IsKernelVirtualAddress(VAddr vaddr); 145bool IsKernelVirtualAddress(VAddr vaddr);
128 146