public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Sergey Bugaev <bugaevc@gmail.com>
To: Samuel Thibault <samuel.thibault@gnu.org>,
	bug-hurd@gnu.org, libc-alpha@sourceware.org
Cc: Sergey Bugaev <bugaevc@gmail.com>
Subject: [PATCH v3 2/2] hurd: Generalize init-first.c to support x86_64
Date: Thu, 23 Feb 2023 18:14:36 +0300	[thread overview]
Message-ID: <20230223151436.49180-2-bugaevc@gmail.com> (raw)
In-Reply-To: <20230223151436.49180-1-bugaevc@gmail.com>

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


  reply	other threads:[~2023-02-23 15:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 21:19 [PATCH v2 0/4] More x86_64-gnu glibc work Sergey Bugaev
2023-02-21 21:19 ` [PATCH v2 1/4] hurd: Simplify init-first.c further Sergey Bugaev
2023-02-22 23:26   ` Samuel Thibault
2023-02-23 13:54     ` Sergey Bugaev
2023-02-23 15:14       ` [PATCH v3 1/2] " Sergey Bugaev
2023-02-23 15:14         ` Sergey Bugaev [this message]
2023-02-24  1:08       ` [PATCH v2 1/4] " Samuel Thibault
2023-02-24 19:43         ` Samuel Thibault
2023-02-21 21:19 ` [PATCH v2 2/4] hurd: Generalize init-first.c to support x86_64 Sergey Bugaev
2023-02-21 21:19 ` [PATCH v2 3/4] hurd: Implement TLS for x86_64 Sergey Bugaev
2023-02-27 22:22   ` Samuel Thibault
2023-02-21 21:19 ` [PATCH v2 4/4] htl: Add pthreadtypes-arch.h " Sergey Bugaev
2023-02-27 22:30   ` Samuel Thibault
2023-02-22 23:32 ` [PATCH v2 0/4] More x86_64-gnu glibc work Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230223151436.49180-2-bugaevc@gmail.com \
    --to=bugaevc@gmail.com \
    --cc=bug-hurd@gnu.org \
    --cc=libc-alpha@sourceware.org \
    --cc=samuel.thibault@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).