summaryrefslogtreecommitdiff
path: root/Source/Core/Common/MemArena.cpp
diff options
context:
space:
mode:
authormagumagu <magumagu9@gmail.com>2015-01-17 13:17:36 -0800
committermagumagu <magumagu9@gmail.com>2015-02-11 13:56:22 -0800
commitac54c6a4e2f6790f628f8a8112ff1940732f5068 (patch)
tree096df265a2517bc5d1e4215e7445ebc7851ad6d8 /Source/Core/Common/MemArena.cpp
parentd9988ee9b5d89b4ac5905dfffabb8ccae2d78a76 (diff)
Make address translation respect the CPU translation mode.
The PowerPC CPU has bits in MSR (DR and IR) which control whether addresses are translated. We should respect these instead of mixing physical addresses and translated addresses into the same address space. This is mostly mass-renaming calls to memory accesses APIs from places which expect address translation to use a different version from those which do not expect address translation. This does very little on its own, but it's the first step to a correct BAT implementation.
Diffstat (limited to 'Source/Core/Common/MemArena.cpp')
-rw-r--r--Source/Core/Common/MemArena.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/Common/MemArena.cpp b/Source/Core/Common/MemArena.cpp
index 544f9354cf..fc910daf9c 100644
--- a/Source/Core/Common/MemArena.cpp
+++ b/Source/Core/Common/MemArena.cpp
@@ -127,12 +127,12 @@ void MemArena::ReleaseView(void* view, size_t size)
}
-u8* MemArena::Find4GBBase()
+u8* MemArena::FindMemoryBase()
{
#if _ARCH_64
#ifdef _WIN32
// 64 bit
- u8* base = (u8*)VirtualAlloc(0, 0xE1000000, MEM_RESERVE, PAGE_READWRITE);
+ u8* base = (u8*)VirtualAlloc(0, 0x400000000, MEM_RESERVE, PAGE_READWRITE);
VirtualFree(base, 0, MEM_RELEASE);
return base;
#else
@@ -250,7 +250,7 @@ u8 *MemoryMap_Setup(MemoryView *views, int num_views, u32 flags, MemArena *arena
arena->GrabSHMSegment(total_mem);
// Now, create views in high memory where there's plenty of space.
- u8 *base = MemArena::Find4GBBase();
+ u8 *base = MemArena::FindMemoryBase();
// This really shouldn't fail - in 64-bit, there will always be enough
// address space.
if (!Memory_TryBase(base, views, num_views, flags, arena))