Blame SOURCES/glibc-rh738665.patch

b9ba6d
2011-09-15  Andreas Schwab  <schwab@redhat.com>
b9ba6d
b9ba6d
	* sysdeps/pthread/list.h: Define only list_t if __need_list_t is
b9ba6d
	defined.
b9ba6d
	(list_add): Add atomic_write_barrier.
b9ba6d
	* descr.h: Define __need_list_t before including <list.h>.
b9ba6d
	* nptl-init.c: Include <list.h>
b9ba6d
	* allocatestack.c: Likewise.
b9ba6d
b9ba6d
2011-09-15  Andreas Schwab  <schwab@redhat.com>
b9ba6d
b9ba6d
	* thread_dbP.h: Include <list.h>
b9ba6d
b9ba6d
Index: glibc-2.12-2-gc4ccff1/nptl/allocatestack.c
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/nptl/allocatestack.c
b9ba6d
+++ glibc-2.12-2-gc4ccff1/nptl/allocatestack.c
b9ba6d
@@ -27,6 +27,7 @@
b9ba6d
 #include <sys/param.h>
b9ba6d
 #include <dl-sysdep.h>
b9ba6d
 #include <tls.h>
b9ba6d
+#include <list.h>
b9ba6d
 #include <lowlevellock.h>
b9ba6d
 #include <kernel-features.h>
b9ba6d
 
b9ba6d
Index: glibc-2.12-2-gc4ccff1/nptl/descr.h
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/nptl/descr.h
b9ba6d
+++ glibc-2.12-2-gc4ccff1/nptl/descr.h
b9ba6d
@@ -26,6 +26,7 @@
b9ba6d
 #include <stdbool.h>
b9ba6d
 #include <sys/types.h>
b9ba6d
 #include <hp-timing.h>
b9ba6d
+#define __need_list_t
b9ba6d
 #include <list.h>
b9ba6d
 #include <lowlevellock.h>
b9ba6d
 #include <pthreaddef.h>
b9ba6d
Index: glibc-2.12-2-gc4ccff1/nptl/nptl-init.c
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/nptl/nptl-init.c
b9ba6d
+++ glibc-2.12-2-gc4ccff1/nptl/nptl-init.c
b9ba6d
@@ -29,6 +29,7 @@
b9ba6d
 #include <atomic.h>
b9ba6d
 #include <ldsodefs.h>
b9ba6d
 #include <tls.h>
b9ba6d
+#include <list.h>
b9ba6d
 #include <fork.h>
b9ba6d
 #include <version.h>
b9ba6d
 #include <shlib-compat.h>
b9ba6d
Index: glibc-2.12-2-gc4ccff1/nptl/sysdeps/pthread/list.h
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/nptl/sysdeps/pthread/list.h
b9ba6d
+++ glibc-2.12-2-gc4ccff1/nptl/sysdeps/pthread/list.h
b9ba6d
@@ -18,27 +18,39 @@
b9ba6d
    02111-1307 USA.  */
b9ba6d
 
b9ba6d
 #ifndef _LIST_H
b9ba6d
-#define _LIST_H	1
b9ba6d
+
b9ba6d
+#ifndef __need_list_t
b9ba6d
+# define _LIST_H	1
b9ba6d
+#endif
b9ba6d
 
b9ba6d
 /* The definitions of this file are adopted from those which can be
b9ba6d
    found in the Linux kernel headers to enable people familiar with
b9ba6d
    the latter find their way in these sources as well.  */
b9ba6d
 
b9ba6d
 
b9ba6d
+#if defined __need_list_t || defined _LIST_H
b9ba6d
+# ifndef __list_t_defined
b9ba6d
+#  define __list_t_defined
b9ba6d
 /* Basic type for the double-link list.  */
b9ba6d
 typedef struct list_head
b9ba6d
 {
b9ba6d
   struct list_head *next;
b9ba6d
   struct list_head *prev;
b9ba6d
 } list_t;
b9ba6d
+# endif
b9ba6d
+# undef __need_list_t
b9ba6d
+#endif
b9ba6d
+
b9ba6d
+#ifdef _LIST_H
b9ba6d
 
b9ba6d
+# include <atomic.h>
b9ba6d
 
b9ba6d
 /* Define a variable with the head and tail of the list.  */
b9ba6d
-#define LIST_HEAD(name) \
b9ba6d
+# define LIST_HEAD(name) \
b9ba6d
   list_t name = { &(name), &(name) }
b9ba6d
 
b9ba6d
 /* Initialize a new list head.  */
b9ba6d
-#define INIT_LIST_HEAD(ptr) \
b9ba6d
+# define INIT_LIST_HEAD(ptr) \
b9ba6d
   (ptr)->next = (ptr)->prev = (ptr)
b9ba6d
 
b9ba6d
 
b9ba6d
@@ -49,6 +61,7 @@ list_add (list_t *newp, list_t *head)
b9ba6d
   newp->next = head->next;
b9ba6d
   newp->prev = head;
b9ba6d
   head->next->prev = newp;
b9ba6d
+  atomic_write_barrier ();
b9ba6d
   head->next = newp;
b9ba6d
 }
b9ba6d
 
b9ba6d
@@ -78,26 +91,28 @@ list_splice (list_t *add, list_t *head)
b9ba6d
 
b9ba6d
 
b9ba6d
 /* Get typed element from list at a given position.  */
b9ba6d
-#define list_entry(ptr, type, member) \
b9ba6d
+# define list_entry(ptr, type, member) \
b9ba6d
   ((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member)))
b9ba6d
 
b9ba6d
 
b9ba6d
 
b9ba6d
 /* Iterate forward over the elements of the list.  */
b9ba6d
-#define list_for_each(pos, head) \
b9ba6d
+# define list_for_each(pos, head) \
b9ba6d
   for (pos = (head)->next; pos != (head); pos = pos->next)
b9ba6d
 
b9ba6d
 
b9ba6d
 /* Iterate forward over the elements of the list.  */
b9ba6d
-#define list_for_each_prev(pos, head) \
b9ba6d
+# define list_for_each_prev(pos, head) \
b9ba6d
   for (pos = (head)->prev; pos != (head); pos = pos->prev)
b9ba6d
 
b9ba6d
 
b9ba6d
 /* Iterate backwards over the elements list.  The list elements can be
b9ba6d
    removed from the list while doing this.  */
b9ba6d
-#define list_for_each_prev_safe(pos, p, head) \
b9ba6d
+# define list_for_each_prev_safe(pos, p, head) \
b9ba6d
   for (pos = (head)->prev, p = pos->prev; \
b9ba6d
        pos != (head); \
b9ba6d
        pos = p, p = pos->prev)
b9ba6d
 
b9ba6d
+#endif /* _LIST_H */
b9ba6d
+
b9ba6d
 #endif	/* list.h */
b9ba6d
Index: glibc-2.12-2-gc4ccff1/nptl_db/thread_dbP.h
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/nptl_db/thread_dbP.h
b9ba6d
+++ glibc-2.12-2-gc4ccff1/nptl_db/thread_dbP.h
b9ba6d
@@ -29,6 +29,7 @@
b9ba6d
 #include "proc_service.h"
b9ba6d
 #include "thread_db.h"
b9ba6d
 #include "../nptl/pthreadP.h"  	/* This is for *_BITMASK only.  */
b9ba6d
+#include <list.h>
b9ba6d
 
b9ba6d
 /* Indeces for the symbol names.  */
b9ba6d
 enum