Otherwise, passing doubles to varargs functions causes a crash.
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
thread->sp = (unsigned long)thread->stack + STACK_SIZE;
/* Save pointer to the thread on the stack, used by current macro */
*((unsigned long *)thread->stack) = (unsigned long)thread;
+
+ /* Must ensure that (%rsp + 8) is 16-byte aligned at the start of thread_starter. */
+ thread->sp -= sizeof(unsigned long);
stack_push(thread, (unsigned long) function);
stack_push(thread, (unsigned long) data);