Unify stack alignment among all platforms

The alignment is now done in Thread_base::Context. Implementations are
forced to use Context::stack_top(), which aligns the stack top.
This commit is contained in:
Christian Helmuth
2014-01-17 17:22:32 +01:00
parent 6ec36350d6
commit 7e517179c9
18 changed files with 52 additions and 56 deletions

View File

@ -123,7 +123,7 @@ void Thread_base::start()
}
/* align initial stack to 16 byte boundary */
void *thread_sp = (void *)((addr_t)(_context->stack) & ~0xf);
void *thread_sp = (void *)((addr_t)(stack_top()) & ~0xf);
_tid.tid = lx_create_thread(Thread_base::_thread_start, thread_sp, this);
_tid.pid = lx_getpid();

View File

@ -54,9 +54,7 @@ void Thread_base::_deinit_platform_thread() { }
void Thread_base::start()
{
/* align initial stack to 16 byte boundary */
void *thread_sp = (void *)((addr_t)(_context->stack) & ~0xf);
_tid.tid = lx_create_thread(Thread_base::_thread_start, thread_sp, this);
_tid.tid = lx_create_thread(Thread_base::_thread_start, stack_top(), this);
_tid.pid = lx_getpid();
}