mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-06-10 03:35:00 -06:00
Dynamically detect 39-bit address space
This commit is contained in:
parent
a762f70df3
commit
e64ec7d2f4
@ -124,7 +124,8 @@ struct AddressSpace::Impl {
|
||||
RTL_OSVERSIONINFOW os_version_info{};
|
||||
RtlGetVersion(&os_version_info);
|
||||
|
||||
u64 supported_user_max = USER_MAX;
|
||||
const VAddr va_size = reinterpret_cast<VAddr>(sys_info.lpMaximumApplicationAddress);
|
||||
u64 supported_user_max = va_size;
|
||||
// This is the build number for Windows 11 22H2
|
||||
static constexpr s32 AffectedBuildNumber = 22621;
|
||||
|
||||
@ -144,7 +145,17 @@ struct AddressSpace::Impl {
|
||||
}
|
||||
|
||||
// Determine the free address ranges we can access.
|
||||
const bool is_39bit = va_size <= 0x7FFFFFFFFFULL;
|
||||
|
||||
VAddr next_addr = SYSTEM_MANAGED_MIN;
|
||||
if (is_39bit) {
|
||||
supported_user_max = 0x7000000000ULL;
|
||||
LOG_WARNING(
|
||||
Core, "39-bit address space detected, reducing user max to {:#x} to avoid problems",
|
||||
supported_user_max);
|
||||
next_addr = 0x80000000ULL;
|
||||
}
|
||||
|
||||
MEMORY_BASIC_INFORMATION info{};
|
||||
while (next_addr <= supported_user_max) {
|
||||
ASSERT_MSG(VirtualQuery(reinterpret_cast<PVOID>(next_addr), &info, sizeof(info)),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user