[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH glibc 15/34] hurd: Use uintptr_t for register values in tramp
From: |
Sergey Bugaev |
Subject: |
[RFC PATCH glibc 15/34] hurd: Use uintptr_t for register values in trampoline.c |
Date: |
Sun, 19 Mar 2023 18:09:58 +0300 |
This is more correct, if only because these fields are defined as having
the type unsigned int in the Mach headers, so casting them to a signed
int and then back is suboptimal.
Also, remove an extra reassignment of uesp -- this is another remnant of
the ecx kludge.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
sysdeps/mach/hurd/i386/trampoline.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/sysdeps/mach/hurd/i386/trampoline.c
b/sysdeps/mach/hurd/i386/trampoline.c
index 8f481e79..ab67fb9c 100644
--- a/sysdeps/mach/hurd/i386/trampoline.c
+++ b/sysdeps/mach/hurd/i386/trampoline.c
@@ -270,24 +270,23 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, const
struct sigaction *action
_hurdsig_end_catch_fault ();
- state->basic.eip = (int) rpc_wait_trampoline;
+ state->basic.eip = (uintptr_t) rpc_wait_trampoline;
/* The reply-receiving trampoline code runs initially on the original
user stack. We pass it the signal stack pointer in %ebx. */
- state->basic.uesp = state->basic.esp; /* Restore mach_msg syscall SP. */
- state->basic.ebx = (int) sigsp;
+ state->basic.ebx = (uintptr_t) sigsp;
/* After doing the message receive, the trampoline code will need to
update the %eax value to be restored by sigreturn. To simplify
the assembly code, we pass the address of its slot in SCP to the
trampoline code in %ecx. */
- state->basic.ecx = (int) &scp->sc_eax;
+ state->basic.ecx = (uintptr_t) &scp->sc_eax;
}
else
{
- state->basic.eip = (int) trampoline;
- state->basic.uesp = (int) sigsp;
+ state->basic.eip = (uintptr_t) trampoline;
+ state->basic.uesp = (uintptr_t) sigsp;
}
/* We pass the handler function to the trampoline code in %edx. */
- state->basic.edx = (int) handler;
+ state->basic.edx = (uintptr_t) handler;
/* The x86 ABI says the DF bit is clear on entry to any function. */
state->basic.efl &= ~EFL_DF;
--
2.39.2
- [RFC PATCH gnumach 02/34] Remove bootstrap.defs, (continued)
- [RFC PATCH gnumach 02/34] Remove bootstrap.defs, Sergey Bugaev, 2023/03/19
- [RFC PATCH gnumach 03/34] Make exception subcode a long, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 04/34] hurd: Make exception subcode a long, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 05/34] hurd: Remove __hurd_threadvar_stack_{offset, mask}, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 09/34] hurd: Fix _hurd_setup_sighandler () signature, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 06/34] hurd: Swap around two function calls, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 07/34] hurd: Fix file name in #error, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 12/34] hurd: More 64-bit integer casting fixes, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 13/34] x86-64: Disable prefer_map_32bit_exec tunable on non-Linux, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 14/34] hurd: Move rtld-strncpy-c.c out of mach/hurd/, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 15/34] hurd: Use uintptr_t for register values in trampoline.c,
Sergey Bugaev <=
- [RFC PATCH glibc 10/34] stdio-common: Fix building when !IS_IN (libc), Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 11/34] mach, hurd: Drop __libc_lock_self0, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 08/34] hurd: Disable O_TRUNC and FS_RETRY_MAGICAL in rtld, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 17/34] hurd: Implement x86_64/intr-msg.h, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 16/34] hurd: Add sys/ucontext.h and sigcontext.h for x86_64, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 18/34] hurd: Port trampoline.c to x86_64, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 19/34] hurd: Move a couple of singal-related files to x86, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 24/34] hurd: Only check for TLS initialization inside rtld or in static builds, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 21/34] x86_64: Add rtld-stpncpy & rtld-strncpy, Sergey Bugaev, 2023/03/19
- [RFC PATCH glibc 23/34] elf: Stop including tls.h in ldsodefs.h, Sergey Bugaev, 2023/03/19