|
Re: thread stack alignment on x86
|
03/06/2010 12:38 PM
post48965
|
Re: thread stack alignment on x86
The example posted needs a bit of correction.
Here is the final code
static void *thread_proc_stackmisaligned(void *param)
{
return ( {
register void *res;
register void *temp;
__asm (
"push %%ebp;"
"movl %%esp, %1;"
"movl %%esp, %%ebp;"
"subl $4, %1;"
"andl $0xfffffff0, %1;"
"movl %1, %%esp;"
"movl %2, (%1);"
"call thread_proc;"
"leave;"
: "=a" (res), "=&r" (temp)
: "r" (param)
);
res;
});
}
|
|
|