فهرست منبع

process: Fix stack memory state.

bunnei 8 سال پیش
والد
کامیت
3923b0f589
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 4 2
      src/core/hle/kernel/process.cpp

+ 4 - 2
src/core/hle/kernel/process.cpp

@@ -117,11 +117,13 @@ void Process::ParseKernelCaps(const u32* kernel_caps, size_t len) {
 }
 }
 
 
 void Process::Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size) {
 void Process::Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size) {
-    // Allocate and map stack
+    // Allocate and map the main thread stack
+    // TODO(bunnei): This is heap area that should be allocated by the kernel and not mapped as part
+    // of the user address space.
     vm_manager
     vm_manager
         .MapMemoryBlock(Memory::HEAP_VADDR_END - stack_size,
         .MapMemoryBlock(Memory::HEAP_VADDR_END - stack_size,
                         std::make_shared<std::vector<u8>>(stack_size, 0), 0, stack_size,
                         std::make_shared<std::vector<u8>>(stack_size, 0), 0, stack_size,
-                        MemoryState::Heap)
+                        MemoryState::Mapped)
         .Unwrap();
         .Unwrap();
     misc_memory_used += stack_size;
     misc_memory_used += stack_size;
     memory_region->used += stack_size;
     memory_region->used += stack_size;