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