|
|
@ -28,12 +28,16 @@ public:
|
|
|
|
~DeviceMemory();
|
|
|
|
~DeviceMemory();
|
|
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
template <typename T>
|
|
|
|
constexpr PAddr GetPhysicalAddr(T* ptr) {
|
|
|
|
PAddr GetPhysicalAddr(const T* ptr) const {
|
|
|
|
return (reinterpret_cast<uintptr_t>(ptr) - reinterpret_cast<uintptr_t>(buffer.data())) +
|
|
|
|
return (reinterpret_cast<uintptr_t>(ptr) - reinterpret_cast<uintptr_t>(buffer.data())) +
|
|
|
|
DramMemoryMap::Base;
|
|
|
|
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);
|
|
|
|
return buffer.data() + (addr - DramMemoryMap::Base);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|