summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-28 23:24:56 +0100
committerLioncash <mathew1800@gmail.com>2019-03-28 23:25:00 +0100
commit2aca7b9e1e6255cf740afec5dd390d0e6726c1e3 (patch)
treeed17be9c99b64d95c7433f69b741344d110d28c3 /src/core/hle/kernel
parentMerge pull request #2284 from lioncash/heap-alloc (diff)
downloadyuzu-2aca7b9e1e6255cf740afec5dd390d0e6726c1e3.tar
yuzu-2aca7b9e1e6255cf740afec5dd390d0e6726c1e3.tar.gz
yuzu-2aca7b9e1e6255cf740afec5dd390d0e6726c1e3.tar.bz2
yuzu-2aca7b9e1e6255cf740afec5dd390d0e6726c1e3.tar.lz
yuzu-2aca7b9e1e6255cf740afec5dd390d0e6726c1e3.tar.xz
yuzu-2aca7b9e1e6255cf740afec5dd390d0e6726c1e3.tar.zst
yuzu-2aca7b9e1e6255cf740afec5dd390d0e6726c1e3.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/process.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index 0d782e4ba..73b4ff961 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -5,6 +5,7 @@
#include <algorithm>
#include <memory>
#include <random>
+#include "common/alignment.h"
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/core.h"
@@ -108,6 +109,9 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata) {
}
void Process::Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size) {
+ // The kernel always ensures that the given stack size is page aligned.
+ stack_size = Common::AlignUp(stack_size, Memory::PAGE_SIZE);
+
// 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.