diff options
| author | 2019-11-26 15:19:15 -0500 | |
|---|---|---|
| committer | 2019-11-26 21:55:38 -0500 | |
| commit | 3f08e8d8d4ef16cf2468620fbfbdac46e43dcaef (patch) | |
| tree | 0e13cc5e2595d7019f8e9e80fe0279dc6a2b1d4c /src/core/memory.h | |
| parent | core: Prepare various classes for memory read/write migration (diff) | |
| download | yuzu-3f08e8d8d4ef16cf2468620fbfbdac46e43dcaef.tar.gz yuzu-3f08e8d8d4ef16cf2468620fbfbdac46e43dcaef.tar.xz yuzu-3f08e8d8d4ef16cf2468620fbfbdac46e43dcaef.zip | |
core/memory: Migrate over GetPointer()
With all of the interfaces ready for migration, it's trivial to migrate
over GetPointer().
Diffstat (limited to 'src/core/memory.h')
| -rw-r--r-- | src/core/memory.h | 22 |
1 files changed, 20 insertions, 2 deletions
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: | |||
| 132 | */ | 132 | */ |
| 133 | bool IsValidVirtualAddress(VAddr vaddr) const; | 133 | bool IsValidVirtualAddress(VAddr vaddr) const; |
| 134 | 134 | ||
| 135 | /** | ||
| 136 | * Gets a pointer to the given address. | ||
| 137 | * | ||
| 138 | * @param vaddr Virtual address to retrieve a pointer to. | ||
| 139 | * | ||
| 140 | * @returns The pointer to the given address, if the address is valid. | ||
| 141 | * If the address is not valid, nullptr will be returned. | ||
| 142 | */ | ||
| 143 | u8* GetPointer(VAddr vaddr); | ||
| 144 | |||
| 145 | /** | ||
| 146 | * Gets a pointer to the given address. | ||
| 147 | * | ||
| 148 | * @param vaddr Virtual address to retrieve a pointer to. | ||
| 149 | * | ||
| 150 | * @returns The pointer to the given address, if the address is valid. | ||
| 151 | * If the address is not valid, nullptr will be returned. | ||
| 152 | */ | ||
| 153 | const u8* GetPointer(VAddr vaddr) const; | ||
| 154 | |||
| 135 | private: | 155 | private: |
| 136 | struct Impl; | 156 | struct Impl; |
| 137 | std::unique_ptr<Impl> impl; | 157 | std::unique_ptr<Impl> impl; |
| @@ -162,8 +182,6 @@ void WriteBlock(VAddr dest_addr, const void* src_buffer, std::size_t size); | |||
| 162 | void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size); | 182 | void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size); |
| 163 | void CopyBlock(VAddr dest_addr, VAddr src_addr, std::size_t size); | 183 | void CopyBlock(VAddr dest_addr, VAddr src_addr, std::size_t size); |
| 164 | 184 | ||
| 165 | u8* GetPointer(VAddr vaddr); | ||
| 166 | |||
| 167 | std::string ReadCString(VAddr vaddr, std::size_t max_length); | 185 | std::string ReadCString(VAddr vaddr, std::size_t max_length); |
| 168 | 186 | ||
| 169 | /** | 187 | /** |