public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Samuel Thibault <sthibaul@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] Define PC, SP and SYSRETURN for hurd x86_64
Date: Mon, 20 Feb 2023 00:33:28 +0000 (GMT)	[thread overview]
Message-ID: <20230220003328.9712F3858D37@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b5b27ff1519d6ca20efcec46bc26964e1c7da68a

commit b5b27ff1519d6ca20efcec46bc26964e1c7da68a
Author: Flavio Cruz <flaviocruz@gmail.com>
Date:   Wed Feb 15 01:16:38 2023 -0500

    Define PC, SP and SYSRETURN for hurd x86_64
    
    Moved thread_state.h to x86 directory since we only need to customize
    those 3 definitions.
    Message-Id: <Y+x4xrsDMkAomncO@jupiter.tail36e24.ts.net>

Diff:
---
 sysdeps/mach/{i386 => x86}/thread_state.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/sysdeps/mach/i386/thread_state.h b/sysdeps/mach/x86/thread_state.h
similarity index 90%
rename from sysdeps/mach/i386/thread_state.h
rename to sysdeps/mach/x86/thread_state.h
index 4e6ce1f7dd..5be0bec150 100644
--- a/sysdeps/mach/i386/thread_state.h
+++ b/sysdeps/mach/x86/thread_state.h
@@ -16,8 +16,8 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _MACH_I386_THREAD_STATE_H
-#define _MACH_I386_THREAD_STATE_H 1
+#ifndef _MACH_X86_THREAD_STATE_H
+#define _MACH_X86_THREAD_STATE_H 1
 
 #include <mach/machine/thread_status.h>
 
@@ -29,9 +29,15 @@
 
 #define machine_thread_state i386_thread_state
 
+#ifdef __x86_64__
+#define PC rip
+#define SP ursp
+#define SYSRETURN rax
+#else
 #define PC eip
 #define SP uesp
 #define SYSRETURN eax
+#endif
 
 #define MACHINE_THREAD_STATE_FIX_NEW(ts) do { \
 	asm ("mov %%cs, %w0" : "=q" ((ts)->cs)); \
@@ -50,4 +56,4 @@ struct machine_thread_all_state
 
 #include <sysdeps/mach/thread_state.h>
 
-#endif /* mach/i386/thread_state.h */
+#endif /* mach/x86/thread_state.h */

                 reply	other threads:[~2023-02-20  0:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230220003328.9712F3858D37@sourceware.org \
    --to=sthibaul@sourceware.org \
    --cc=glibc-cvs@sourceware.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).