Merge pull request #323 from shadps4-emu/win-fix
address_space: Fix windows placeholder mapping
This commit is contained in:
commit
bc28ed66e8
|
@ -59,11 +59,11 @@ struct AddressSpace::Impl {
|
|||
static constexpr size_t MaxReductions = 10;
|
||||
|
||||
size_t reduction = 0;
|
||||
size_t virtual_size = SystemManagedSize + SystemReservedSize + UserSize;
|
||||
for (u32 i = 0; i < MaxReductions; i++) {
|
||||
req.LowestStartingAddress = reinterpret_cast<PVOID>(SYSTEM_MANAGED_MIN + reduction);
|
||||
virtual_base = static_cast<u8*>(VirtualAlloc2(
|
||||
process, NULL, SystemManagedSize + SystemReservedSize + UserSize - reduction,
|
||||
MEM_RESERVE | MEM_RESERVE_PLACEHOLDER, PAGE_NOACCESS, ¶m, 1));
|
||||
virtual_base = static_cast<u8*>(VirtualAlloc2(process, NULL, virtual_size - reduction,
|
||||
MEM_RESERVE | MEM_RESERVE_PLACEHOLDER,
|
||||
PAGE_NOACCESS, ¶m, 1));
|
||||
if (virtual_base) {
|
||||
break;
|
||||
}
|
||||
|
@ -92,9 +92,7 @@ struct AddressSpace::Impl {
|
|||
const uintptr_t system_managed_addr = reinterpret_cast<uintptr_t>(system_managed_base);
|
||||
const uintptr_t system_reserved_addr = reinterpret_cast<uintptr_t>(system_reserved_base);
|
||||
const uintptr_t user_addr = reinterpret_cast<uintptr_t>(user_base);
|
||||
placeholders.insert({system_managed_addr, system_managed_addr + system_managed_size});
|
||||
placeholders.insert({system_reserved_addr, system_reserved_addr + system_reserved_size});
|
||||
placeholders.insert({user_addr, user_addr + user_size});
|
||||
placeholders.insert({system_managed_addr, virtual_size - reduction});
|
||||
|
||||
// Allocate backing file that represents the total physical memory.
|
||||
backing_handle =
|
||||
|
|
|
@ -22,7 +22,7 @@ constexpr VAddr CODE_BASE_OFFSET = 0x100000000ULL;
|
|||
|
||||
constexpr VAddr SYSTEM_MANAGED_MIN = 0x00000400000ULL;
|
||||
constexpr VAddr SYSTEM_MANAGED_MAX = 0x07FFFFBFFFULL;
|
||||
constexpr VAddr SYSTEM_RESERVED_MIN = 0x800000000ULL;
|
||||
constexpr VAddr SYSTEM_RESERVED_MIN = 0x07FFFFC000ULL;
|
||||
#ifdef __APPLE__
|
||||
// Can only comfortably reserve the first 0x7C0000000 of system reserved space.
|
||||
constexpr VAddr SYSTEM_RESERVED_MAX = 0xFBFFFFFFFULL;
|
||||
|
|
Loading…
Reference in New Issue