From d438eed871f875dcf4676b83c3d3ae62f32f491a Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Fri, 23 Nov 2007 13:47:05 +0000 Subject: 2007-11-23 Neal H. Walfield * pthread/pt-internal.h (__pthread_startup): Add declaration. * pthread/pt-create.c (entry_point): Call __pthread_startup. * sysdeps/l4/hurd/pt-sysdep.h: Include and . (PTHREAD_SYSDEP_MEMBERS): Add fields object, exception_handler_stack and exception_handler_sp. (__attribute__): Call munmap. * sysdeps/l4/hurd/ia32/pt-setup.c (__pthread_setup): Set up thread->exception_handler_sp. Don't set the user define handle here. * sysdeps/l4/hurd/pt-startup.c: New file. Do it here. * sysdeps/l4/hurd/pt-thread-alloc.c: New file. * sysdeps/l4/hurd/pt-thread-halt.c: New file. * sysdeps/l4/hurd/pt-thread-start.c: New file. * Makefile.am (libpthread_a_SOURCES): Add pt-startup.c. * sysdeps/l4/pt-block.c: Include . (__pthread_block): Detect IPC failure. Add debugging output. * sysdeps/l4/pt-wakeup.c: Include . (__pthread_wakeup): Detect IPC failure. Add debugging output. --- sysdeps/l4/hurd/ia32/pt-setup.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'sysdeps/l4/hurd/ia32') diff --git a/sysdeps/l4/hurd/ia32/pt-setup.c b/sysdeps/l4/hurd/ia32/pt-setup.c index e244dc16..a179bdfd 100644 --- a/sysdeps/l4/hurd/ia32/pt-setup.c +++ b/sysdeps/l4/hurd/ia32/pt-setup.c @@ -63,10 +63,14 @@ __pthread_setup (struct __pthread *thread, thread->mcontext.pc = entry_point; thread->mcontext.sp = stack_setup (thread, start_routine, arg); - if (l4_same_threads (thread->threadid, l4_myself ())) - l4_set_user_defined_handle ((l4_word_t) thread); - else - l4_set_user_defined_handle_of (thread->threadid, - (l4_word_t) thread); + + if (__pthread_num_threads != 1) + { + assert (! ADDR_IS_VOID (thread->exception_handler_stack.addr)); + thread->exception_handler_sp + = ADDR_TO_PTR (addr_extend (thread->exception_handler_stack.addr, + 0, PAGESIZE_LOG2)); + } + return 0; } -- cgit v1.2.3