Print this page
6507 i386 makecontext(3c) needs to 16-byte align the stack
*** 27,44 ****
#include <procfs.h>
#include <ucontext.h>
#include <setjmp.h>
/*
! * The i386 ABI says that the stack pointer need be only 4-byte aligned
! * before a function call (STACK_ALIGN == 4). We use a 16-byte stack
! * alignment for the benefit of floating point code compiled using sse2.
! * Even though the i386 ABI doesn't require it, both cc and gcc
! * assume this alignment on entry to a function and maintain it
! * for calls made from that function. If the stack is initially
! * aligned on a 16-byte boundary, it will continue to be so aligned.
! * If it is not initially so aligned, it will never become so aligned.
*/
#undef STACK_ALIGN
#define STACK_ALIGN 16
extern int getlwpstatus(thread_t, lwpstatus_t *);
--- 27,45 ----
#include <procfs.h>
#include <ucontext.h>
#include <setjmp.h>
/*
! * The stack needs to be 16-byte aligned with a 4-byte bias. See comment in
! * lib/libc/i386/gen/makectxt.c.
! *
! * Note: If you change it, you need to change it in the following files as
! * well:
! *
! * - lib/libc/i386/gen/makectxt.c
! * - lib/common/i386/crti.s
! * - lib/common/i386/crt1.s
*/
#undef STACK_ALIGN
#define STACK_ALIGN 16
extern int getlwpstatus(thread_t, lwpstatus_t *);