[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 2/2] hurd: Generalize init-first.c to support x86_64
From: |
Sergey Bugaev |
Subject: |
[PATCH v3 2/2] hurd: Generalize init-first.c to support x86_64 |
Date: |
Thu, 23 Feb 2023 18:14:36 +0300 |
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%)
diff --git a/sysdeps/mach/hurd/i386/init-first.c
b/sysdeps/mach/hurd/x86/init-first.c
similarity index 97%
rename from sysdeps/mach/hurd/i386/init-first.c
rename to sysdeps/mach/hurd/x86/init-first.c
index 05424563..2fccaefd 100644
--- a/sysdeps/mach/hurd/i386/init-first.c
+++ b/sysdeps/mach/hurd/x86/init-first.c
@@ -225,9 +225,15 @@ _hurd_stack_setup (void)
void doinit (intptr_t *data)
{
init ((void **) 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 ();
}
--
2.39.2
[PATCH v2 2/4] hurd: Generalize init-first.c to support x86_64, Sergey Bugaev, 2023/02/21
[PATCH v2 3/4] hurd: Implement TLS for x86_64, Sergey Bugaev, 2023/02/21
[PATCH v2 4/4] htl: Add pthreadtypes-arch.h for x86_64, Sergey Bugaev, 2023/02/21
Re: [PATCH v2 0/4] More x86_64-gnu glibc work, Samuel Thibault, 2023/02/22