[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r2323 - in /fsf/trunk/libc: ./ nptl/ nptl/sysdeps/alpha/ nptl/sysdeps/i386/ nptl/sysdeps/ia64/ nptl/sysdeps/powerpc/ nptl/sy...



Author: eglibc
Date: Tue May 29 00:02:38 2007
New Revision: 2323

Log:
Import glibc-mainline for 2007-05-29

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/allocatestack.c
    fsf/trunk/libc/nptl/descr.h
    fsf/trunk/libc/nptl/sysdeps/alpha/tls.h
    fsf/trunk/libc/nptl/sysdeps/i386/tls.h
    fsf/trunk/libc/nptl/sysdeps/ia64/tls.h
    fsf/trunk/libc/nptl/sysdeps/powerpc/tls.h
    fsf/trunk/libc/nptl/sysdeps/s390/tls.h
    fsf/trunk/libc/nptl/sysdeps/sh/tls.h
    fsf/trunk/libc/nptl/sysdeps/sparc/tls.h
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c
    fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/futimes.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue May 29 00:02:38 2007
@@ -1,3 +1,8 @@
+2007-05-28  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/futimes.c (miss_utimensat): Don't define
+	if __NR_utimensat is not defined.
+
 2007-05-26  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/powerpc/libc-start.c: Include <sysdep.h>.

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Tue May 29 00:02:38 2007
@@ -1,3 +1,45 @@
+2007-05-28  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c: Include
+	unistd.h.
+
+	* sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Use explicit
+	insn suffix.
+	(THREAD_GSCOPE_GET_FLAG): Remove.
+	* sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Remove.
+	* allocatestack.c (__wait_lookup_done): Revert 2007-05-24
+	changes.
+	* sysdeps/powerpc/tls.h (tcbhead_t): Remove gscope_flag.
+	(THREAD_GSCOPE_GET_FLAG): Remove.
+	(THREAD_GSCOPE_RESET_FLAG): Use THREAD_SELF->header.gscope_flag
+	instead of THREAD_GSCOPE_GET_FLAG.
+	(THREAD_GSCOPE_SET_FLAG): Likewise.  Add atomic_write_barrier after
+	it.
+	* sysdeps/s390/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
+	THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
+	THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
+	THREAD_GSCOPE_WAIT): Define.
+	* sysdeps/sparc/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
+	THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
+	THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
+	THREAD_GSCOPE_WAIT): Define.
+	* sysdeps/sh/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
+	THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
+	THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
+	THREAD_GSCOPE_WAIT): Define.
+	* sysdeps/ia64/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
+	THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
+	THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
+	THREAD_GSCOPE_WAIT): Define.
+
+2007-05-24  Richard Henderson  <rth@xxxxxxxxxx>
+
+	* descr.h (struct pthread): Add header.gscope_flag.
+	* sysdeps/alpha/tls.h (THREAD_GSCOPE_FLAG_UNUSED,
+	THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT,
+	THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_SET_FLAG,
+	THREAD_GSCOPE_WAIT): Define.
+
 2007-05-27  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* init.c: Make it compile with older kernel headers.

Modified: fsf/trunk/libc/nptl/allocatestack.c
==============================================================================
--- fsf/trunk/libc/nptl/allocatestack.c (original)
+++ fsf/trunk/libc/nptl/allocatestack.c Tue May 29 00:02:38 2007
@@ -1021,10 +1021,10 @@
   list_for_each (runp, &stack_used)
     {
       struct pthread *t = list_entry (runp, struct pthread, list);
-      if (t == self || THREAD_GSCOPE_GET_FLAG (t) == THREAD_GSCOPE_FLAG_UNUSED)
+      if (t == self || t->header.gscope_flag == THREAD_GSCOPE_FLAG_UNUSED)
 	continue;
 
-      int *const gscope_flagp = &THREAD_GSCOPE_GET_FLAG (t);
+      int *const gscope_flagp = &t->header.gscope_flag;
 
       /* We have to wait until this thread is done with the global
 	 scope.  First tell the thread that we are waiting and
@@ -1043,10 +1043,10 @@
   list_for_each (runp, &__stack_user)
     {
       struct pthread *t = list_entry (runp, struct pthread, list);
-      if (t == self || THREAD_GSCOPE_GET_FLAG (t) == THREAD_GSCOPE_FLAG_UNUSED)
+      if (t == self || t->header.gscope_flag == THREAD_GSCOPE_FLAG_UNUSED)
 	continue;
 
-      int *const gscope_flagp = &THREAD_GSCOPE_GET_FLAG (t);
+      int *const gscope_flagp = &t->header.gscope_flag;
 
       /* We have to wait until this thread is done with the global
 	 scope.  First tell the thread that we are waiting and

Modified: fsf/trunk/libc/nptl/descr.h
==============================================================================
--- fsf/trunk/libc/nptl/descr.h (original)
+++ fsf/trunk/libc/nptl/descr.h Tue May 29 00:02:38 2007
@@ -132,6 +132,7 @@
     struct
     {
       int multiple_threads;
+      int gscope_flag;
 # ifndef __ASSUME_PRIVATE_FUTEX
       int private_futex;
 # endif

Modified: fsf/trunk/libc/nptl/sysdeps/alpha/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/alpha/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/alpha/tls.h Tue May 29 00:02:38 2007
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/Alpha version.
-   Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -121,6 +121,29 @@
 #define THREAD_SETMEM_NC(descr, member, idx, value) \
   descr->member[idx] = (value)
 
+/* Get and set the global scope generation counter in struct pthread.  */
+#define THREAD_GSCOPE_FLAG_UNUSED 0
+#define THREAD_GSCOPE_FLAG_USED   1
+#define THREAD_GSCOPE_FLAG_WAIT   2
+#define THREAD_GSCOPE_RESET_FLAG() \
+  do									     \
+    { int __res								     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
+			       THREAD_GSCOPE_FLAG_UNUSED);		     \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_SET_FLAG() \
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
 #endif /* __ASSEMBLER__ */
 
 #endif	/* tls.h */

Modified: fsf/trunk/libc/nptl/sysdeps/i386/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/i386/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/i386/tls.h Tue May 29 00:02:38 2007
@@ -444,7 +444,7 @@
 #define THREAD_GSCOPE_RESET_FLAG() \
   do									      \
     { int __res;							      \
-      asm volatile ("xchg %0, %%gs:%P1"					      \
+      asm volatile ("xchgl %0, %%gs:%P1"				      \
 		    : "=r" (__res)					      \
 		    : "i" (offsetof (struct pthread, header.gscope_flag)),    \
 		      "0" (THREAD_GSCOPE_FLAG_UNUSED));			      \
@@ -454,7 +454,6 @@
   while (0)
 #define THREAD_GSCOPE_SET_FLAG() \
   THREAD_SETMEM (THREAD_SELF, header.gscope_flag, THREAD_GSCOPE_FLAG_USED)
-#define THREAD_GSCOPE_GET_FLAG(descr) (descr)->header.gscope_flag
 #define THREAD_GSCOPE_WAIT() \
   GL(dl_wait_lookup_done) ()
 

Modified: fsf/trunk/libc/nptl/sysdeps/ia64/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/ia64/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/ia64/tls.h Tue May 29 00:02:38 2007
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  nptl/IA-64 version.
-   Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -163,6 +163,29 @@
   (((uintptr_t *) ((char *) (descr) + TLS_PRE_TCB_SIZE))[-2] \
    = THREAD_GET_POINTER_GUARD ())
 
+/* Get and set the global scope generation counter in struct pthread.  */
+#define THREAD_GSCOPE_FLAG_UNUSED 0
+#define THREAD_GSCOPE_FLAG_USED   1
+#define THREAD_GSCOPE_FLAG_WAIT   2
+#define THREAD_GSCOPE_RESET_FLAG() \
+  do									     \
+    { int __res								     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
+			       THREAD_GSCOPE_FLAG_UNUSED);		     \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_SET_FLAG() \
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
 #endif /* __ASSEMBLER__ */
 
 #endif	/* tls.h */

Modified: fsf/trunk/libc/nptl/sysdeps/powerpc/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/powerpc/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/powerpc/tls.h Tue May 29 00:02:38 2007
@@ -63,11 +63,10 @@
 # include <nptl/descr.h>
 
 /* The stack_guard is accessed directly by GCC -fstack-protector code,
-   so it is a part of public ABI.  The dtv, pointer_guard and gscope_flag
-   fields are private.  */
+   so it is a part of public ABI.  The dtv and pointer_guard fields
+   are private.  */
 typedef struct
 {
-  int gscope_flag;
   uintptr_t pointer_guard;
   uintptr_t stack_guard;
   dtv_t *dtv;
@@ -181,24 +180,26 @@
    different value to mean unset l_tls_offset.  */
 # define NO_TLS_OFFSET		-1
 
-/* Get and set the global scope generation counter in the TCB head.  */
+/* Get and set the global scope generation counter in struct pthread.  */
 #define THREAD_GSCOPE_FLAG_UNUSED 0
 #define THREAD_GSCOPE_FLAG_USED   1
 #define THREAD_GSCOPE_FLAG_WAIT   2
-#define THREAD_GSCOPE_GET_FLAG(descr) \
-  (((tcbhead_t *) ((char *) (descr)					     \
-		   + TLS_PRE_TCB_SIZE))[-1].gscope_flag)
 #define THREAD_GSCOPE_RESET_FLAG() \
   do									     \
     { int __res								     \
-	= atomic_exchange_rel (&THREAD_GSCOPE_GET_FLAG (THREAD_SELF),	     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
 			       THREAD_GSCOPE_FLAG_UNUSED);		     \
       if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
-	lll_futex_wake (&THREAD_GSCOPE_GET_FLAG (THREAD_SELF), 1);	     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
     }									     \
   while (0)
 #define THREAD_GSCOPE_SET_FLAG() \
-  (THREAD_GSCOPE_GET_FLAG (THREAD_SELF) = THREAD_GSCOPE_FLAG_USED)
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
 #define THREAD_GSCOPE_WAIT() \
   GL(dl_wait_lookup_done) ()
 

Modified: fsf/trunk/libc/nptl/sysdeps/s390/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/s390/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/s390/tls.h Tue May 29 00:02:38 2007
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/s390 version.
-   Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -27,6 +27,7 @@
 # include <stdint.h>
 # include <stdlib.h>
 # include <list.h>
+# include <kernel-features.h>
 
 
 /* Type for the dtv.  */
@@ -50,6 +51,10 @@
   int multiple_threads;
   uintptr_t sysinfo;
   uintptr_t stack_guard;
+  int gscope_flag;
+#ifndef __ASSUME_PRIVATE_FUTEX
+  int private_futex;
+#endif
 } tcbhead_t;
 
 # ifndef __s390x__
@@ -168,6 +173,29 @@
 #define THREAD_SET_POINTER_GUARD(value)
 #define THREAD_COPY_POINTER_GUARD(descr)
 
+/* Get and set the global scope generation counter in struct pthread.  */
+#define THREAD_GSCOPE_FLAG_UNUSED 0
+#define THREAD_GSCOPE_FLAG_USED   1
+#define THREAD_GSCOPE_FLAG_WAIT   2
+#define THREAD_GSCOPE_RESET_FLAG() \
+  do									     \
+    { int __res								     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
+			       THREAD_GSCOPE_FLAG_UNUSED);		     \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_SET_FLAG() \
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
 #endif /* __ASSEMBLER__ */
 
 #endif	/* tls.h */

Modified: fsf/trunk/libc/nptl/sysdeps/sh/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/sh/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/sh/tls.h Tue May 29 00:02:38 2007
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/SH version.
-   Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -150,6 +150,29 @@
      __asm __volatile ("stc gbr,%0" : "=r" (__tcbp));			      \
      ((tcbhead_t *) (descr + 1))->pointer_guard	= __tcbp->pointer_guard;})
 
+/* Get and set the global scope generation counter in struct pthread.  */
+#define THREAD_GSCOPE_FLAG_UNUSED 0
+#define THREAD_GSCOPE_FLAG_USED   1
+#define THREAD_GSCOPE_FLAG_WAIT   2
+#define THREAD_GSCOPE_RESET_FLAG() \
+  do									     \
+    { int __res								     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
+			       THREAD_GSCOPE_FLAG_UNUSED);		     \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_SET_FLAG() \
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
 #endif /* __ASSEMBLER__ */
 
 #endif	/* tls.h */

Modified: fsf/trunk/libc/nptl/sysdeps/sparc/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/sparc/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/sparc/tls.h Tue May 29 00:02:38 2007
@@ -1,5 +1,5 @@
 /* Definitions for thread-local data handling.  NPTL/sparc version.
-   Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -141,6 +141,29 @@
 # define THREAD_COPY_POINTER_GUARD(descr) \
   ((descr)->header.pointer_guard = THREAD_GET_POINTER_GUARD ())
 
+/* Get and set the global scope generation counter in struct pthread.  */
+#define THREAD_GSCOPE_FLAG_UNUSED 0
+#define THREAD_GSCOPE_FLAG_USED   1
+#define THREAD_GSCOPE_FLAG_WAIT   2
+#define THREAD_GSCOPE_RESET_FLAG() \
+  do									     \
+    { int __res								     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
+			       THREAD_GSCOPE_FLAG_UNUSED);		     \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1);		     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_SET_FLAG() \
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
+#define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
 #endif /* !ASSEMBLER */
 
 #endif	/* tls.h */

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_attr_setstacksize.c Tue May 29 00:02:38 2007
@@ -1,3 +1,4 @@
+#include <unistd.h>	/* For __getpagesize.  */
 #define NEW_VERNUM GLIBC_2_6
 #define STACKSIZE_ADJUST \
   do {									      \

Modified: fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h Tue May 29 00:02:38 2007
@@ -360,7 +360,6 @@
   while (0)
 #define THREAD_GSCOPE_SET_FLAG() \
   THREAD_SETMEM (THREAD_SELF, header.gscope_flag, THREAD_GSCOPE_FLAG_USED)
-#define THREAD_GSCOPE_GET_FLAG(descr) (descr)->header.gscope_flag
 #define THREAD_GSCOPE_WAIT() \
   GL(dl_wait_lookup_done) ()
 

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/futimes.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/futimes.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/futimes.c Tue May 29 00:02:38 2007
@@ -1,5 +1,5 @@
 /* futimes -- change access and modification times of open file.  Linux version.
-   Copyright (C) 2002,2003,2005,2006 Free Software Foundation, Inc.
+   Copyright (C) 2002,2003,2005,2006,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -29,7 +29,7 @@
 #include <kernel-features.h>
 
 
-#ifndef __ASSUME_UTIMENSAT
+#if defined __NR_utimensat && !defined __ASSUME_UTIMENSAT
 static int miss_utimensat;
 #endif