summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-05-11 05:08:47 -0300
committerGravatar Yuri Kunde Schlesner2015-05-11 05:08:47 -0300
commitd16c2bd956a69754e1c2aef6600c10d944638673 (patch)
treed2d6638d66ff1f6aa7f0e341e6ea139b68b6ef24
parentMerge pull request #740 from yuriks/gsp-shmem (diff)
downloadyuzu-d16c2bd956a69754e1c2aef6600c10d944638673.tar.gz
yuzu-d16c2bd956a69754e1c2aef6600c10d944638673.tar.xz
yuzu-d16c2bd956a69754e1c2aef6600c10d944638673.zip
Thread: Correctly set main thread initial stack position
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/process.cpp2
-rw-r--r--src/core/hle/kernel/thread.cpp4
-rw-r--r--src/core/hle/kernel/thread.h3
3 files changed, 4 insertions, 5 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index 26a9c2360..efae4a179 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -85,7 +85,7 @@ void Process::ParseKernelCaps(const u32* kernel_caps, size_t len) {
85} 85}
86 86
87void Process::Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size) { 87void Process::Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size) {
88 Kernel::SetupMainThread(stack_size, entry_point, main_thread_priority); 88 Kernel::SetupMainThread(entry_point, main_thread_priority);
89} 89}
90 90
91Kernel::Process::Process() {} 91Kernel::Process::Process() {}
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 5de8f9a73..957cbdfee 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -458,12 +458,12 @@ SharedPtr<Thread> SetupIdleThread() {
458 return thread; 458 return thread;
459} 459}
460 460
461SharedPtr<Thread> SetupMainThread(u32 stack_size, u32 entry_point, s32 priority) { 461SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority) {
462 DEBUG_ASSERT(!GetCurrentThread()); 462 DEBUG_ASSERT(!GetCurrentThread());
463 463
464 // Initialize new "main" thread 464 // Initialize new "main" thread
465 auto thread_res = Thread::Create("main", entry_point, priority, 0, 465 auto thread_res = Thread::Create("main", entry_point, priority, 0,
466 THREADPROCESSORID_0, Memory::HEAP_VADDR_END - stack_size); 466 THREADPROCESSORID_0, Memory::HEAP_VADDR_END);
467 467
468 SharedPtr<Thread> thread = thread_res.MoveFrom(); 468 SharedPtr<Thread> thread = thread_res.MoveFrom();
469 469
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index 6891c8c2f..afdaf8511 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -181,12 +181,11 @@ private:
181 181
182/** 182/**
183 * Sets up the primary application thread 183 * Sets up the primary application thread
184 * @param stack_size The size of the thread's stack
185 * @param entry_point The address at which the thread should start execution 184 * @param entry_point The address at which the thread should start execution
186 * @param priority The priority to give the main thread 185 * @param priority The priority to give the main thread
187 * @return A shared pointer to the main thread 186 * @return A shared pointer to the main thread
188 */ 187 */
189SharedPtr<Thread> SetupMainThread(u32 stack_size, u32 entry_point, s32 priority); 188SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority);
190 189
191/** 190/**
192 * Reschedules to the next available thread (call after current thread is suspended) 191 * Reschedules to the next available thread (call after current thread is suspended)