From e48f33e76be2a3baa920b7e9f472354f7ff0c0a6 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sat, 18 Feb 2023 23:37:09 +0300 Subject: hurd: Move thread state manipulation into _hurd_tls_new () This is going to be done differently on x86_64. Signed-off-by: Sergey Bugaev Message-Id: <20230218203717.373211-2-bugaevc@gmail.com> --- mach/setup-thread.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'mach') diff --git a/mach/setup-thread.c b/mach/setup-thread.c index 6ce5c13d37..ae24a14955 100644 --- a/mach/setup-thread.c +++ b/mach/setup-thread.c @@ -83,25 +83,11 @@ weak_alias (__mach_setup_thread, mach_setup_thread) kern_return_t __mach_setup_tls (thread_t thread) { - kern_return_t error; - struct machine_thread_state ts; - mach_msg_type_number_t tssize = MACHINE_THREAD_STATE_COUNT; - tcbhead_t *tcb; - - tcb = _dl_allocate_tls (NULL); + tcbhead_t *tcb = _dl_allocate_tls (NULL); if (tcb == NULL) return KERN_RESOURCE_SHORTAGE; - if (error = __thread_get_state (thread, MACHINE_THREAD_STATE_FLAVOR, - (natural_t *) &ts, &tssize)) - return error; - assert (tssize == MACHINE_THREAD_STATE_COUNT); - - _hurd_tls_new (thread, &ts, tcb); - - error = __thread_set_state (thread, MACHINE_THREAD_STATE_FLAVOR, - (natural_t *) &ts, tssize); - return error; + return _hurd_tls_new (thread, tcb); } weak_alias (__mach_setup_tls, mach_setup_tls) -- cgit 1.4.1