From 9aae19cd9aaf10e7d99c56f9d7d820c5b792faeb Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 15 Jul 2000 19:02:47 +0000 Subject: Update. 2000-05-05 H.J. Lu * sysdeps/ia64/pt-machine.h (__compare_and_swap): Change it to have acquire semantics. (__compare_and_swap_with_release_semantics): New inline function. (HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS): New macro. 2000-01-28 Hans Boehm * manager.c: Fix the problem with signals at startup. Change the way that thread stacks are allocated on IA64. Clean up some of the guard page allocation stuff. 1999-12-19 H.J. Lu * internals.h (page_roundup): New. * attr.c (__pthread_attr_setguardsize); Use page_roundup instead of roundup. * manager.c (pthread_allocate_stack): Make sure guardaddr is page aligned with page_roundup if NEED_SEPARATE_REGISTER_STACK is define. 1999-12-17 Hans Boehm * manager.c (pthread_allocate_stack): Unmap the stack top if failed to map the stack bottom. Fix the guard page. (pthread_free): Fix the guard page. * pthread.c (pthread_initialize): Set rlimit correctly for NEED_SEPARATE_REGISTER_STACK. 1999-12-16 H.J. Lu * pthread.c (__pthread_initialize_manager): Pass __pthread_manager_thread_bos instead of __pthread_manager_thread_tos to __clone2. 1999-12-16 H.J. Lu * manager.c (pthread_allocate_stack): Correct the calculation of "new_thread_bottom". Remove MAP_GROWSDOWN from mmap for stack bottom. 1999-12-13 H.J. Lu * sysdeps/ia64/pt-machine.h (__compare_and_swap): Added a stop bit after setting ar.ccv. 1999-12-12 H.J. Lu * manager.c (pthread_allocate_stack): Make the starting address of the stack bottom page aligned. FIXME: it may need changes in other places. (pthread_handle_create): Likewise. 1999-12-11 Hans Boehm * manager.c (pthread_allocate_stack): Handle NEED_SEPARATE_REGISTER_STACK. (pthread_handle_create): Likewise. * pthread.c (__pthread_initialize_manager): Likewise. * sysdeps/ia64/pt-machine.h: Use r13 for thread pointer. 1999-12-02 H.J. Lu * sysdeps/ia64/pt-machine.h: New. --- linuxthreads/pthread.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'linuxthreads/pthread.c') diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c index 2700a29..d70e3f4 100644 --- a/linuxthreads/pthread.c +++ b/linuxthreads/pthread.c @@ -362,7 +362,13 @@ static void pthread_initialize(void) /* Play with the stack size limit to make sure that no stack ever grows beyond STACK_SIZE minus one page (to act as a guard page). */ getrlimit(RLIMIT_STACK, &limit); +#ifdef NEED_SEPARATE_REGISTER_STACK + /* STACK_SIZE bytes hold both the main stack and register backing + store. The rlimit value applies to each individually. */ + max_stack = STACK_SIZE/2 - __getpagesize(); +#else max_stack = STACK_SIZE - __getpagesize(); +#endif if (limit.rlim_cur > max_stack) { limit.rlim_cur = max_stack; setrlimit(RLIMIT_STACK, &limit); @@ -444,10 +450,18 @@ int __pthread_initialize_manager(void) | __pthread_initial_thread.p_eventbuf.eventmask.event_bits[idx])) != 0) { +#ifdef NEED_SEPARATE_REGISTER_STACK + pid = __clone2(__pthread_manager_event, + (void **) __pthread_manager_thread_bos, + THREAD_MANAGER_STACK_SIZE, + CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, + (void *)(long)manager_pipe[0]); +#else pid = __clone(__pthread_manager_event, (void **) __pthread_manager_thread_tos, CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, (void *)(long)manager_pipe[0]); +#endif if (pid != -1) { @@ -472,9 +486,18 @@ int __pthread_initialize_manager(void) } if (pid == 0) - pid = __clone(__pthread_manager, (void **) __pthread_manager_thread_tos, - CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, - (void *)(long)manager_pipe[0]); + { +#ifdef NEED_SEPARATE_REGISTER_STACK + pid = __clone2(__pthread_manager, (void **) __pthread_manager_thread_bos, + THREAD_MANAGER_STACK_SIZE, + CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, + (void *)(long)manager_pipe[0]); +#else + pid = __clone(__pthread_manager, (void **) __pthread_manager_thread_tos, + CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, + (void *)(long)manager_pipe[0]); +#endif + } if (pid == -1) { free(__pthread_manager_thread_bos); __libc_close(manager_pipe[0]); -- cgit v1.1