[Zion] Modify the alignement of the initial user stack pointer.

This commit is contained in:
Drew Galbraith 2023-11-21 14:53:59 -08:00
parent a1e1e1c2d8
commit 0b8e2d8268
1 changed files with 4 additions and 0 deletions

View File

@ -61,6 +61,10 @@ void Thread::Init() {
dbgln("Thread start.", pid(), id_); dbgln("Thread start.", pid(), id_);
#endif #endif
uint64_t rsp = process_.vmas()->AllocateUserStack(); uint64_t rsp = process_.vmas()->AllocateUserStack();
// TODO: Investigate this further but without this GCC
// will emit movaps calls to non-16-bit-aligned stack
// addresses.
rsp -= 0x8;
SetRsp0(rsp0_start_); SetRsp0(rsp0_start_);
jump_user_space(rip_, rsp, arg1_, arg2_); jump_user_space(rip_, rsp, arg1_, arg2_);
} }