diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index 9d3a619363..abe5690ba9 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -48,17 +48,6 @@ #ifndef MAP_ANONYMOUS # define MAP_ANONYMOUS MAP_ANON #endif -// PlayStation 4 -// Flag needs to be undef-ed on non PS4 since it has different semantics -// on some platforms. -#ifndef MAP_SYSTEM -# ifdef __OPENORBIS__ -# define MAP_SYSTEM 0x2000 -# else -# undef MAP_SYSTEM -# define MAP_SYSTEM 0 -# endif -#endif #endif // ^^^ POSIX ^^^ diff --git a/src/core/device_memory.h b/src/core/device_memory.h index b5103e23bc..29d2ff7a2b 100644 --- a/src/core/device_memory.h +++ b/src/core/device_memory.h @@ -29,30 +29,22 @@ public: template Common::PhysicalAddress GetPhysicalAddr(const T* ptr) const { - return GetPhysicalAddr(reinterpret_cast(ptr)); - } - - Common::PhysicalAddress GetPhysicalAddr(uintptr_t ptr) const { - return (ptr - reinterpret_cast(buffer.BackingBasePointer())) + - DramMemoryMap::Base; + return (uintptr_t(ptr) - uintptr_t(buffer.BackingBasePointer())) + DramMemoryMap::Base; } template PAddr GetRawPhysicalAddr(const T* ptr) const { - return static_cast(reinterpret_cast(ptr) - - reinterpret_cast(buffer.BackingBasePointer())); + return PAddr(uintptr_t(ptr) - uintptr_t(buffer.BackingBasePointer())); } template T* GetPointer(Common::PhysicalAddress addr) { - return reinterpret_cast(buffer.BackingBasePointer() + - (GetInteger(addr) - DramMemoryMap::Base)); + return reinterpret_cast(buffer.BackingBasePointer() + (GetInteger(addr) - DramMemoryMap::Base)); } template const T* GetPointer(Common::PhysicalAddress addr) const { - return reinterpret_cast(buffer.BackingBasePointer() + - (GetInteger(addr) - DramMemoryMap::Base)); + return reinterpret_cast(buffer.BackingBasePointer() + (GetInteger(addr) - DramMemoryMap::Base)); } template