aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2015-05-11 11:03:08 -0400
committerGravatar bunnei <bunneidev@gmail.com>2015-05-11 11:03:08 -0400
commit10eb8b0c02badb2f87ec2d71f1679a27b679c171 (patch)
tree920742b7261c7c801d2c6e21e35ded349dceda08 /src/core
parent244ba1a6101659d155dadb02068029d0d1922fa7 (diff)
parentd16c2bd956a69754e1c2aef6600c10d944638673 (diff)
Merge pull request #749 from yuriks/stack-top
Thread: Correctly set main thread initial stack position
Diffstat (limited to 'src/core')
-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 26a9c236..efae4a17 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) {
}
void Process::Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size) {
- Kernel::SetupMainThread(stack_size, entry_point, main_thread_priority);
+ Kernel::SetupMainThread(entry_point, main_thread_priority);
}
Kernel::Process::Process() {}
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 5de8f9a7..957cbdfe 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -458,12 +458,12 @@ SharedPtr<Thread> SetupIdleThread() {
return thread;
}
-SharedPtr<Thread> SetupMainThread(u32 stack_size, u32 entry_point, s32 priority) {
+SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority) {
DEBUG_ASSERT(!GetCurrentThread());
// Initialize new "main" thread
auto thread_res = Thread::Create("main", entry_point, priority, 0,
- THREADPROCESSORID_0, Memory::HEAP_VADDR_END - stack_size);
+ THREADPROCESSORID_0, Memory::HEAP_VADDR_END);
SharedPtr<Thread> thread = thread_res.MoveFrom();
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index 6891c8c2..afdaf851 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -181,12 +181,11 @@ private:
/**
* Sets up the primary application thread
- * @param stack_size The size of the thread's stack
* @param entry_point The address at which the thread should start execution
* @param priority The priority to give the main thread
* @return A shared pointer to the main thread
*/
-SharedPtr<Thread> SetupMainThread(u32 stack_size, u32 entry_point, s32 priority);
+SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority);
/**
* Reschedules to the next available thread (call after current thread is suspended)