similarity index 97%
rename from sysdeps/mach/hurd/i386/init-first.c
rename to sysdeps/mach/hurd/x86/init-first.c
@@ -238,9 +238,15 @@ _hurd_stack_setup (void)
void doinit (intptr_t *data)
{
init ((int *) data);
+# ifdef __x86_64__
+ asm volatile ("movq %0, %%rsp\n" /* Switch to new outermost stack. */
+ "xorq %%rbp, %%rbp\n" /* Clear outermost frame pointer. */
+ "jmp *%1" : : "r" (data), "r" (caller));
+# else
asm volatile ("movl %0, %%esp\n" /* Switch to new outermost stack. */
"xorl %%ebp, %%ebp\n" /* Clear outermost frame pointer. */
"jmp *%1" : : "r" (data), "r" (caller));
+# endif
__builtin_unreachable ();
}
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> --- sysdeps/mach/hurd/{i386 => x86}/init-first.c | 6 ++++++ 1 file changed, 6 insertions(+) rename sysdeps/mach/hurd/{i386 => x86}/init-first.c (97%)