mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
dde_bsd: update 'platform_execute()' functions based on libc
This ensures proper stack alignment for FPU instructions on x86_64. Fixes #3357
This commit is contained in:
parent
c7d9df6350
commit
3fa994a7a4
@ -36,6 +36,7 @@ void platform_execute(void *sp, void *func, void *arg)
|
||||
asm volatile ("movl %2, 0(%0);"
|
||||
"movl %1, -0x4(%0);"
|
||||
"movl %0, %%esp;"
|
||||
"xorl %%ebp, %%ebp;" /* clear frame pointer */
|
||||
"call *-4(%%esp);"
|
||||
: : "r" (sp), "r" (func), "r" (arg));
|
||||
}
|
||||
|
@ -34,11 +34,15 @@ int _setjmp(jmp_buf);
|
||||
static inline
|
||||
void platform_execute(void *sp, void *func, void *arg)
|
||||
{
|
||||
asm volatile ("movq %2, %%rdi;"
|
||||
"movq %1, 0(%0);"
|
||||
"movq %0, %%rsp;"
|
||||
"call *0(%%rsp);"
|
||||
: "+r" (sp), "+r" (func), "+r" (arg) : : "memory");
|
||||
asm volatile ("movq %0, %%rsp;" /* load stack pointer */
|
||||
"movq %%rsp, %%rbp;" /* caller stack frame (for GDB debugging) */
|
||||
"movq %0, -8(%%rbp);"
|
||||
"movq %1, -16(%%rbp);"
|
||||
"movq %2, -24(%%rbp);"
|
||||
"sub $24, %%rsp;" /* adjust to next stack frame */
|
||||
"movq %2, %%rdi;" /* 1st argument */
|
||||
"call *-16(%%rbp);" /* call func */
|
||||
: : "r" (sp), "r" (func), "r" (arg));
|
||||
}
|
||||
|
||||
#endif /* _X86_64__PLATFORM_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user