diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2022-10-19 16:27:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-19 16:27:43 -0400 |
| commit | 560bca57a203c45acb1c589699b472223e8b68fd (patch) | |
| tree | 98ef4a0d62a368614075463d13c4220b11af9760 /src/core/device_memory.h | |
| parent | b8a70c9999b9a09d7028a617040719bf5341cf6d (diff) | |
| parent | 97879faea43c1fad6cbb0b63573c75644705e2e9 (diff) | |
Merge pull request #9071 from bunnei/mp-mm
Kernel Multiprocess (Part 1) - Persist memory & core timing
Diffstat (limited to 'src/core/device_memory.h')
| -rw-r--r-- | src/core/device_memory.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/device_memory.h b/src/core/device_memory.h index df61b0c0b..90510733c 100644 --- a/src/core/device_memory.h +++ b/src/core/device_memory.h @@ -31,12 +31,14 @@ public: DramMemoryMap::Base; } - u8* GetPointer(PAddr addr) { - return buffer.BackingBasePointer() + (addr - DramMemoryMap::Base); + template <typename T> + T* GetPointer(PAddr addr) { + return reinterpret_cast<T*>(buffer.BackingBasePointer() + (addr - DramMemoryMap::Base)); } - const u8* GetPointer(PAddr addr) const { - return buffer.BackingBasePointer() + (addr - DramMemoryMap::Base); + template <typename T> + const T* GetPointer(PAddr addr) const { + return reinterpret_cast<T*>(buffer.BackingBasePointer() + (addr - DramMemoryMap::Base)); } Common::HostMemory buffer; |
