]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* elf/Makefile ($(objpfx)librtld.mk): Tweak regexp so that one-line
authorRoland McGrath <roland@gnu.org>
Thu, 13 Mar 2003 21:51:07 +0000 (21:51 +0000)
committerRoland McGrath <roland@gnu.org>
Thu, 13 Mar 2003 21:51:07 +0000 (21:51 +0000)
entries in the map file match too.

ChangeLog
elf/Makefile
nptl/ChangeLog
nptl/allocatestack.c
nptl/pthreadP.h
nptl/pthread_create.c
nptl/sysdeps/ia64/td_ta_map_lwp2thr.c
nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h

index 24776932cf739045782385ec492b65c170f09305..766e332b713265058336e827d0d4acc89c736530 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-13  Roland McGrath  <roland@redhat.com>
+
+       * elf/Makefile ($(objpfx)librtld.mk): Tweak regexp so that one-line
+       entries in the map file match too.
+
 2003-03-13  Guido Guenther  <agx@sigxcpu.org>
 
        * sysdeps/unix/sysv/linux/mips/clone.S: introduce and use local
index 205957c3e41edd9ccdbb8d3f7361f06bac51c33c..7c3f0f187e335a34847b4ac040c4efafb30504c0 100644 (file)
@@ -210,7 +210,8 @@ $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
        mv -f $@T $@
 
 $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile
-       sed -n 's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\))$$@\1 \2@p' $< | \
+       sed -n 's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
+           $< | \
        while read lib file; do \
          case $$lib in \
          libc_pic.a) \
index f3bc8e914b8b16491929298409891575219e4496..37464db17508fa503db6e86a33069058cc5d3b02 100644 (file)
@@ -1,5 +1,28 @@
+2003-03-13  Roland McGrath  <roland@redhat.com>
+
+       * pthread_create.c (start_thread): Set EXITING_BIT after the
+       event-reporting (and destructors), not before.
+
 2003-03-13  Jakub Jelinek  <jakub@redhat.com>
 
+       * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
+       lll_futex_wake): Declare register variables as long int instead of
+       unsigned long int.  Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
+       Make syscall arguments clobbered by the syscall.
+       (lll_futex_wait): Define using lll_futex_timed_wait.
+
+       * sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
+       to void *.
+
+       * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
+       PPID if [! NDEBUG].
+
+       * allocatestack.c (nptl_ncreated): Only declare if
+       COLORING_INCREMENT != 0.
+
+       * pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
+       (__libc_enable_asynccancel_2): Remove prototype.
+
        * sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
        ctid to match kernel.
 
index ece951109f0b53b68b9dfee7e92436f0c6dcf726..a43d94a0cd81e0f3c3ee8dd8c944f2405e79aafd 100644 (file)
@@ -104,8 +104,10 @@ static LIST_HEAD (stack_used);
 list_t __stack_user __attribute__ ((nocommon));
 hidden_def (__stack_user)
 
+#if COLORING_INCREMENT != 0
 /* Number of threads created.  */
 static unsigned int nptl_ncreated;
+#endif
 
 
 /* Check whether the stack is still used or not.  */
@@ -352,7 +354,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
       void *mem;
 
 #if COLORING_INCREMENT != 0
-      /* Add one more page for stack coloring.  Don't to it for stacks
+      /* Add one more page for stack coloring.  Don't do it for stacks
         with 16 times pagesize or larger.  This might just cause
         unnecessary misalignment.  */
       if (size <= 16 * pagesize_m1)
@@ -383,8 +385,8 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
          if (__builtin_expect (mem == MAP_FAILED, 0))
            return errno;
 
-         /* 'size' is guaranteed to be greater than zero.  So we can
-            never get a NULL pointer back from MMAP.  */
+         /* SIZE is guaranteed to be greater than zero.
+            So we can never get a null pointer back from mmap.  */
          assert (mem != NULL);
 
 #if COLORING_INCREMENT != 0
index 1ab1badb0ce30090a234eed41e8eae74f258742d..bb2736ef6806df1aeda4675cffdfe0ef5fb980e0 100644 (file)
@@ -314,6 +314,8 @@ extern int __pthread_kill (pthread_t threadid, int signo);
 extern void __pthread_exit (void *value);
 extern int __pthread_setcanceltype (int type, int *oldtype);
 extern int __pthread_enable_asynccancel (void) attribute_hidden;
+extern void __pthread_enable_asynccancel_2 (int *oldvalp)
+     internal_function attribute_hidden;
 extern void __pthread_disable_asynccancel (int oldtype)
      internal_function attribute_hidden;
 
@@ -332,8 +334,6 @@ extern int __pthread_cond_wait_2_0 (pthread_cond_2_0_t *cond,
 
 /* The two functions are in libc.so and not exported.  */
 extern int __libc_enable_asynccancel (void) attribute_hidden;
-extern void __libc_enable_asynccancel_2 (int *oldvalp)
-     internal_function attribute_hidden;
 extern void __libc_disable_asynccancel (int oldtype)
      internal_function attribute_hidden;
 
index 58116f7925516a8d20bb2c55a52ce5f126e71ba8..519d0c6f60fd45a1e320198f619d314388c2ea37 100644 (file)
@@ -227,9 +227,6 @@ start_thread (void *arg)
       THREAD_SETMEM (pd, result, pd->start_routine (pd->arg));
     }
 
-  /* The thread is exiting now.  */
-  atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
-
   /* Clean up any state libc stored in thread-local variables.  */
   __libc_thread_freeres ();
 
@@ -268,6 +265,10 @@ start_thread (void *arg)
        }
     }
 
+  /* The thread is exiting now.  Don't set this bit until after we've hit
+     the event-reporting breakpoint, so that td_thr_get_info on us while at
+     the breakpoint reports TD_THR_RUN state rather than TD_THR_ZOMBIE.  */
+  atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
 
   /* If the thread is detached free the TCB.  */
   if (IS_DETACHED (pd))
index 0931ce944d0262ca3dbf287320de7cc707e14f91..a8231848ea499069f1777eae01aa996cd81145dc 100644 (file)
@@ -35,7 +35,7 @@ td_ta_map_lwp2thr (const td_thragent_t *ta, lwpid_t lwpid, td_thrhandle_t *th)
     return TD_ERR;
 
   /* IA-64 thread register is r13.  */
-  th->th_unique = regs[13];
+  th->th_unique = (void *) regs[13];
 
   /* Found it.  Now complete the `td_thrhandle_t' object.  */
   th->th_ta_p = (td_thragent_t *) ta;
index 8fcc7f15ac2c3d4cf9a9d2984fbd63f0a45c6dc7..b64bf1ca15aad9351af63ba643cbe0ca8383f0c9 100644 (file)
   "b6", "b7",                                                                \
   "memory"
 
-#define lll_futex_wait(futex, val) \
-  ({                                                                         \
-     register unsigned long int __o0 asm ("out0")                            \
-       = (unsigned long int) (futex);                                        \
-     register unsigned long int __o1 asm ("out1") = FUTEX_WAIT;                      \
-     register unsigned long int __o2 asm ("out2") = (unsigned long int) (val);\
-     register unsigned long int __o3 asm ("out3") = 0ul;                     \
-     register unsigned long int __r8 asm ("r8");                             \
-     register unsigned long int __r10 asm ("r10");                           \
-     register unsigned long int __r15 asm ("r15") = SYS_futex;               \
-                                                                             \
-     __asm __volatile ("break %3;;"                                          \
-                      : "=r" (__r8), "=r" (__r10), "=r" (__r15)              \
-                      : "i" (0x100000), "2" (__r15), "r" (__o0), "r" (__o1), \
-                       "r" (__o2), "r" (__o3)                                \
-                      : lll_futex_clobbers);                                 \
-     __r10 == -1 ? -__r8 : __r8;                                             \
-  })
-
+#define lll_futex_wait(futex, val) lll_futex_timed_wait (futex, val, 0)
 
 #define lll_futex_timed_wait(futex, val, timespec) \
   ({                                                                         \
-     register unsigned long int __o0 asm ("out0")                            \
-       = (unsigned long int) (futex);                                        \
-     register unsigned long int __o1 asm ("out1") = FUTEX_WAIT;                      \
-     register unsigned long int __o2 asm ("out2") = (unsigned long int) (val);\
-     register unsigned long int __o3 asm ("out3")                            \
-       = (unsigned long int) (timespec);                                     \
-     register unsigned long int __r8 asm ("r8");                             \
-     register unsigned long int __r10 asm ("r10");                           \
-     register unsigned long int __r15 asm ("r15") = SYS_futex;               \
+     register long int __o0 asm ("out0") = (long int) (futex);               \
+     register long int __o1 asm ("out1") = FUTEX_WAIT;                       \
+     register long int __o2 asm ("out2") = (long int) (val);                 \
+     register long int __o3 asm ("out3") = (long int) (timespec);            \
+     register long int __r8 asm ("r8");                                              \
+     register long int __r10 asm ("r10");                                    \
+     register long int __r15 asm ("r15") = SYS_futex;                        \
                                                                              \
-     __asm __volatile ("break %3;;"                                          \
-                      : "=r" (__r8), "=r" (__r10), "=r" (__r15)              \
-                      : "i" (0x100000), "2" (__r15), "r" (__o0), "r" (__o1), \
-                        "r" (__o2), "r" (__o3)                               \
+     __asm __volatile ("break %7;;"                                          \
+                      : "=r" (__r8), "=r" (__r10), "=r" (__r15),             \
+                        "=r" (__o0), "=r" (__o1), "=r" (__o2), "=r" (__o3)   \
+                      : "i" (0x100000), "2" (__r15), "3" (__o0), "4" (__o1), \
+                        "5" (__o2), "6" (__o3)                               \
                       : lll_futex_clobbers);                                 \
      __r10 == -1 ? -__r8 : __r8;                                             \
   })
 
 #define lll_futex_wake(futex, nr) \
   ({                                                                         \
-     register unsigned long int __o0 asm ("out0")                            \
-       = (unsigned long int) (futex);                                        \
-     register unsigned long int __o1 asm ("out1") = FUTEX_WAKE;                      \
-     register unsigned long int __o2 asm ("out2") = (unsigned long int) (nr); \
-     register unsigned long int __r8 asm ("r8");                             \
-     register unsigned long int __r10 asm ("r10");                           \
-     register unsigned long int __r15 asm ("r15") = SYS_futex;               \
+     register long int __o0 asm ("out0") = (long int) (futex);               \
+     register long int __o1 asm ("out1") = FUTEX_WAKE;                       \
+     register long int __o2 asm ("out2") = (long int) (nr);                  \
+     register long int __r8 asm ("r8");                                              \
+     register long int __r10 asm ("r10");                                    \
+     register long int __r15 asm ("r15") = SYS_futex;                        \
                                                                              \
-     __asm __volatile ("break %3;;"                                          \
-                      : "=r" (__r8), "=r" (__r10), "=r" (__r15)              \
-                      : "i" (0x100000), "2" (__r15), "r" (__o0), "r" (__o1), \
-                        "r" (__o2)                                           \
+     __asm __volatile ("break %6;;"                                          \
+                      : "=r" (__r8), "=r" (__r10), "=r" (__r15),             \
+                        "=r" (__o0), "=r" (__o1), "=r" (__o2)                \
+                      : "i" (0x100000), "2" (__r15), "3" (__o0), "4" (__o1), \
+                        "5" (__o2)                                           \
                       : "out3", lll_futex_clobbers);                         \
      __r10 == -1 ? -__r8 : __r8;                                             \
   })