From 92caa003a8fabf177f012a4f59ac4e123cbb4e98 Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 15 Apr 2020 23:06:29 -0400 Subject: [PATCH] core: device_memory: Remove incorrect usage of constexpr. --- src/core/device_memory.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/device_memory.h b/src/core/device_memory.h index cc7bda0709..ff66e202d6 100644 --- a/src/core/device_memory.h +++ b/src/core/device_memory.h @@ -28,12 +28,16 @@ public: ~DeviceMemory(); template - constexpr PAddr GetPhysicalAddr(T* ptr) { + PAddr GetPhysicalAddr(const T* ptr) const { return (reinterpret_cast(ptr) - reinterpret_cast(buffer.data())) + DramMemoryMap::Base; } - constexpr u8* GetPointer(PAddr addr) { + u8* GetPointer(PAddr addr) { + return buffer.data() + (addr - DramMemoryMap::Base); + } + + const u8* GetPointer(PAddr addr) const { return buffer.data() + (addr - DramMemoryMap::Base); }