summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/device_memory.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/device_memory.h b/src/core/device_memory.h
index cc7bda070..ff66e202d 100644
--- a/src/core/device_memory.h
+++ b/src/core/device_memory.h
@@ -28,12 +28,16 @@ public:
28 ~DeviceMemory(); 28 ~DeviceMemory();
29 29
30 template <typename T> 30 template <typename T>
31 constexpr PAddr GetPhysicalAddr(T* ptr) { 31 PAddr GetPhysicalAddr(const T* ptr) const {
32 return (reinterpret_cast<uintptr_t>(ptr) - reinterpret_cast<uintptr_t>(buffer.data())) + 32 return (reinterpret_cast<uintptr_t>(ptr) - reinterpret_cast<uintptr_t>(buffer.data())) +
33 DramMemoryMap::Base; 33 DramMemoryMap::Base;
34 } 34 }
35 35
36 constexpr u8* GetPointer(PAddr addr) { 36 u8* GetPointer(PAddr addr) {
37 return buffer.data() + (addr - DramMemoryMap::Base);
38 }
39
40 const u8* GetPointer(PAddr addr) const {
37 return buffer.data() + (addr - DramMemoryMap::Base); 41 return buffer.data() + (addr - DramMemoryMap::Base);
38 } 42 }
39 43