Changed default stack location
This commit is contained in:
parent
40f858baec
commit
749a59e424
|
@ -220,7 +220,7 @@ void XThread::InitializeGuestObject() {
|
|||
}
|
||||
|
||||
bool XThread::AllocateStack(uint32_t size) {
|
||||
auto heap = memory()->LookupHeap(0x70000000);
|
||||
auto heap = memory()->LookupHeap(kStackAddressRangeBegin);
|
||||
|
||||
auto alignment = heap->page_size();
|
||||
auto padding = heap->page_size() * 2; // Guard page size * 2
|
||||
|
@ -228,10 +228,10 @@ bool XThread::AllocateStack(uint32_t size) {
|
|||
auto actual_size = size + padding;
|
||||
|
||||
uint32_t address = 0;
|
||||
if (!heap->AllocRange(0x70000000, 0x7F000000, actual_size, alignment,
|
||||
kMemoryAllocationReserve | kMemoryAllocationCommit,
|
||||
kMemoryProtectRead | kMemoryProtectWrite, false,
|
||||
&address)) {
|
||||
if (!heap->AllocRange(
|
||||
kStackAddressRangeBegin, kStackAddressRangeEnd, actual_size,
|
||||
alignment, kMemoryAllocationReserve | kMemoryAllocationCommit,
|
||||
kMemoryProtectRead | kMemoryProtectWrite, false, &address)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ bool XThread::AllocateStack(uint32_t size) {
|
|||
|
||||
void XThread::FreeStack() {
|
||||
if (stack_alloc_base_) {
|
||||
auto heap = memory()->LookupHeap(0x70000000);
|
||||
auto heap = memory()->LookupHeap(kStackAddressRangeBegin);
|
||||
heap->Release(stack_alloc_base_);
|
||||
|
||||
stack_alloc_base_ = 0;
|
||||
|
|
|
@ -109,6 +109,9 @@ class XThread : public XObject, public cpu::Thread {
|
|||
|
||||
enum StartupType { Normal, XapiThreadStartup, DllMain };
|
||||
|
||||
static constexpr uint32_t kStackAddressRangeBegin = 0x70000000;
|
||||
static constexpr uint32_t kStackAddressRangeEnd = 0x7F000000;
|
||||
|
||||
struct CreationParams {
|
||||
uint32_t stack_size;
|
||||
StartupType startup_type;
|
||||
|
|
Loading…
Reference in New Issue