[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 12/20] mach: Declare the new thread_set_self_state () trap
From: |
Sergey Bugaev |
Subject: |
[PATCH v2 12/20] mach: Declare the new thread_set_self_state () trap |
Date: |
Sat, 23 Mar 2024 20:32:53 +0300 |
This is a new Mach trap for setting the state of the current thread, as
if with thread_set_state () RPC. The trap has been added to GNU Mach as
a part of the AArch64 port, to make it possible to implement sigreturn
in glibc; however, the trap itself is fully arch-independent.
There does not seem to be an easy way to feature-test, in a header, for
existence of traps in the Mach version being built against. Instead,
just declare the trap prototype unconditionally, and don't add an
exported version for now.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
sysdeps/mach/include/mach/mach_traps.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sysdeps/mach/include/mach/mach_traps.h
b/sysdeps/mach/include/mach/mach_traps.h
index c4334952..a942212c 100644
--- a/sysdeps/mach/include/mach/mach_traps.h
+++ b/sysdeps/mach/include/mach/mach_traps.h
@@ -19,5 +19,12 @@ kern_return_t __thread_switch (mach_port_t new_thread,
libc_hidden_proto (__thread_switch)
kern_return_t __evc_wait (unsigned int event);
libc_hidden_proto (__evc_wait)
+
+/* Set current thread's state, as if with thread_set_state() RPC.
+ This syscall is only really available in recent enough GNU Mach. */
+extern kern_return_t __thread_set_self_state (int flavor,
+ natural_t *new_state,
+ natural_t new_state_count);
+libc_hidden_proto (__thread_set_self_state)
#endif
#endif
--
2.44.0
- [PATCH v2 04/20] hurd: Disable Prefer_MAP_32BIT_EXEC on non-x86_64 for now, (continued)
- [PATCH v2 04/20] hurd: Disable Prefer_MAP_32BIT_EXEC on non-x86_64 for now, Sergey Bugaev, 2024/03/23
- [PATCH v2 06/20] htl: Respect GL(dl_stack_flags) when allocating stacks, Sergey Bugaev, 2024/03/23
- [PATCH v2 08/20] aarch64: Add dl-procinfo, Sergey Bugaev, 2024/03/23
- [PATCH v2 11/20] mach: Add a basic AArch64 port, Sergey Bugaev, 2024/03/23
- [PATCH v2 13/20] hurd: Add a basic AArch64 port, Sergey Bugaev, 2024/03/23
- [PATCH v2 18/20] htl: Implement some support for TLS_DTV_AT_TP, Sergey Bugaev, 2024/03/23
- [PATCH v2 02/20] hurd: Stop relying on VM_MAX_ADDRESS, Sergey Bugaev, 2024/03/23
- [PATCH v2 03/20] Allow glibc to be compiled without EXEC_PAGESIZE, Sergey Bugaev, 2024/03/23
- [PATCH v2 07/20] aarch64: Move pointer_guard.h out of sysdeps/unix/sysv/linux, Sergey Bugaev, 2024/03/23
- [PATCH v2 10/20] aarch64: Allow building without kernel support for BTI, Sergey Bugaev, 2024/03/23
- [PATCH v2 12/20] mach: Declare the new thread_set_self_state () trap,
Sergey Bugaev <=
- [PATCH v2 15/20] hurd: Implement longjmp for AArch64, Sergey Bugaev, 2024/03/23
- [PATCH v2 17/20] hurd: Add an AArch64 signal implementation, Sergey Bugaev, 2024/03/23
- [PATCH v2 09/20] aarch64: Move saving user entry into _dl_start_user, Sergey Bugaev, 2024/03/23
- [PATCH v2 14/20] hurd: Implement TLS on AArch64, Sergey Bugaev, 2024/03/23
- [PATCH v2 16/20] Add FPE_FLTIDO, Sergey Bugaev, 2024/03/23
- [PATCH v2 19/20] htl: Add an AArch64 implementation, Sergey Bugaev, 2024/03/23
- [PATCH v2 20/20] hurd: Add expected aarch64-gnu abistlists, Sergey Bugaev, 2024/03/23
- Re: [PATCH v2 00/20] aarch64-gnu port & GNU/Hurd on AArch64 progress, Samuel Thibault, 2024/03/23