summaryrefslogtreecommitdiff
path: root/sysdeps/mach/thread_state.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-03-17 03:17:36 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-03-17 03:17:36 +0100
commitf8baf2a2242029600beb213d3f042e7c0482e502 (patch)
tree43df708e6da8a0cb7520bb218d6ebfcecfe54c86 /sysdeps/mach/thread_state.h
parentc553cd6f7e939ae4ef62b52b3c55fbe76dddecee (diff)
hurd: add TLS support
* sysdeps/generic/thread_state.h (MACHINE_NEW_THREAD_STATE_FLAVOR): Define macro. * sysdeps/mach/thread_state.h (MACHINE_THREAD_STATE_FIX_NEW): New macro. * sysdeps/mach/i386/thread_state.h (MACHINE_NEW_THREAD_STATE_FLAVOR): New macro, defined to i386_THREAD_STATE. (MACHINE_THREAD_STATE_FLAVOR): Define to i386_REGS_SEGS_STATE instead of i386_THREAD_STATE. (MACHINE_THREAD_STATE_FIX_NEW): New macro, reads segments. * sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler): Use i386_REGS_SEGS_STATE instead of i386_THREAD_STATE. * sysdeps/mach/hurd/i386/tls.h (TCB_ALIGNMENT, HURD_SEL_LDT): New macros. (_hurd_tls_fork): Add original thread parameter, Duplicate existing LDT descriptor instead of creating a new one. (_hurd_tls_new): New function, creates a new descriptor and updates tcb. * mach/setup-thread.c: Include <ldsodefs.h>. (__mach_setup_thread): Call _dl_allocate_tls, pass MACHINE_NEW_THREAD_STATE_FLAVOR to __thread_set_state instead of MACHINE_THREAD_STATE_FLAVOR, before getting MACHINE_THREAD_STATE_FLAVOR, calling _hurd_tls_new, and setting MACHINE_THREAD_STATE_FLAVOR with the result. * hurd/hurdfault.c (_hurdsig_fault_init): Call MACHINE_THREAD_STATE_FIX_NEW. * sysdeps/mach/hurd/fork.c (__fork): Call _hurd_tls_fork for sigthread too. Add original thread parameter.
Diffstat (limited to 'sysdeps/mach/thread_state.h')
-rw-r--r--sysdeps/mach/thread_state.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/mach/thread_state.h b/sysdeps/mach/thread_state.h
index bc4feefe01..2e3a10cbcb 100644
--- a/sysdeps/mach/thread_state.h
+++ b/sysdeps/mach/thread_state.h
@@ -38,6 +38,12 @@
#endif
#endif
+/* This copies architecture-specific bits from the current thread to the new
+ thread state. */
+#ifndef MACHINE_THREAD_STATE_FIX_NEW
+# define MACHINE_THREAD_STATE_FIX_NEW(ts)
+#endif
+
/* These functions are of use in machine-dependent signal trampoline
implementations. */