mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-28 00:00:35 +01:00
Merge pull request #5539 from Sonicadvance1/162
arm64ec: Fixes some FEX allocations that were missing TOP_DOWN
This commit is contained in:
3 files changed
+6
-5
No files matched your search
Vendored
+1
-1
Submodule External/rpmalloc updated: 1f6fb494f2...1d85c246cd.
@@ -619,7 +619,7 @@ NTSTATUS ProcessInit() {
|
||||
|
||||
CPUFeatures.emplace(*CTX);
|
||||
|
||||
X64ReturnInstr = ::VirtualAlloc(nullptr, FEXCore::Utils::FEX_PAGE_SIZE, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
||||
X64ReturnInstr = ::VirtualAlloc(nullptr, FEXCore::Utils::FEX_PAGE_SIZE, MEM_COMMIT | MEM_TOP_DOWN, PAGE_EXECUTE_READWRITE);
|
||||
InvalidationTracker->HandleMemoryProtectionNotification(reinterpret_cast<uint64_t>(X64ReturnInstr), FEXCore::Utils::FEX_PAGE_SIZE,
|
||||
PAGE_EXECUTE_READ);
|
||||
*reinterpret_cast<uint8_t*>(X64ReturnInstr) = 0xc3;
|
||||
@@ -919,7 +919,8 @@ NTSTATUS ThreadInit() {
|
||||
const auto CPUArea = GetCPUArea();
|
||||
|
||||
static constexpr size_t EmulatorStackSize = 0x40000;
|
||||
const uint64_t EmulatorStack = reinterpret_cast<uint64_t>(::VirtualAlloc(nullptr, EmulatorStackSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE));
|
||||
const uint64_t EmulatorStack =
|
||||
reinterpret_cast<uint64_t>(::VirtualAlloc(nullptr, EmulatorStackSize, MEM_COMMIT | MEM_RESERVE | MEM_TOP_DOWN, PAGE_READWRITE));
|
||||
CPUArea.EmulatorStackLimit() = EmulatorStack;
|
||||
CPUArea.EmulatorStackBase() = EmulatorStack + EmulatorStackSize;
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ CallRetStackInfo GetInfoThread(FEXCore::Core::InternalThreadState* Thread) {
|
||||
|
||||
void InitializeThread(FEXCore::Core::InternalThreadState* Thread) {
|
||||
// Allocate the call-ret stack with guard pages on both sides
|
||||
const void* CallRetStackAlloc = ::VirtualAlloc(
|
||||
nullptr, FEXCore::Core::InternalThreadState::CALLRET_STACK_SIZE + 2 * FEXCore::Utils::FEX_PAGE_SIZE, MEM_RESERVE, PAGE_NOACCESS);
|
||||
const void* CallRetStackAlloc = ::VirtualAlloc(nullptr, FEXCore::Core::InternalThreadState::CALLRET_STACK_SIZE + 2 * FEXCore::Utils::FEX_PAGE_SIZE,
|
||||
MEM_RESERVE | MEM_TOP_DOWN, PAGE_NOACCESS);
|
||||
|
||||
FEXCore::Allocator::VirtualName("FEXMem_CallRetStacks", CallRetStackAlloc,
|
||||
FEXCore::Core::InternalThreadState::CALLRET_STACK_SIZE + 2 * FEXCore::Utils::FEX_PAGE_SIZE);
|
||||
|
||||
Reference in new issue
Block a user