1 2011-09-15 Andreas Schwab <schwab@redhat.com>
3 * sysdeps/pthread/list.h: Define only list_t if __need_list_t is
5 (list_add): Add atomic_write_barrier.
6 * descr.h: Define __need_list_t before including <list.h>.
7 * nptl-init.c: Include <list.h>
8 * allocatestack.c: Likewise.
10 2011-09-15 Andreas Schwab <schwab@redhat.com>
12 * thread_dbP.h: Include <list.h>
14 Index: glibc-2.12-2-gc4ccff1/nptl/allocatestack.c
15 ===================================================================
16 --- glibc-2.12-2-gc4ccff1.orig/nptl/allocatestack.c
17 +++ glibc-2.12-2-gc4ccff1/nptl/allocatestack.c
19 #include <sys/param.h>
20 #include <dl-sysdep.h>
23 #include <lowlevellock.h>
24 #include <kernel-features.h>
26 Index: glibc-2.12-2-gc4ccff1/nptl/descr.h
27 ===================================================================
28 --- glibc-2.12-2-gc4ccff1.orig/nptl/descr.h
29 +++ glibc-2.12-2-gc4ccff1/nptl/descr.h
32 #include <sys/types.h>
33 #include <hp-timing.h>
34 +#define __need_list_t
36 #include <lowlevellock.h>
37 #include <pthreaddef.h>
38 Index: glibc-2.12-2-gc4ccff1/nptl/nptl-init.c
39 ===================================================================
40 --- glibc-2.12-2-gc4ccff1.orig/nptl/nptl-init.c
41 +++ glibc-2.12-2-gc4ccff1/nptl/nptl-init.c
49 #include <shlib-compat.h>
50 Index: glibc-2.12-2-gc4ccff1/nptl/sysdeps/pthread/list.h
51 ===================================================================
52 --- glibc-2.12-2-gc4ccff1.orig/nptl/sysdeps/pthread/list.h
53 +++ glibc-2.12-2-gc4ccff1/nptl/sysdeps/pthread/list.h
60 +#ifndef __need_list_t
64 /* The definitions of this file are adopted from those which can be
65 found in the Linux kernel headers to enable people familiar with
66 the latter find their way in these sources as well. */
69 +#if defined __need_list_t || defined _LIST_H
70 +# ifndef __list_t_defined
71 +# define __list_t_defined
72 /* Basic type for the double-link list. */
73 typedef struct list_head
75 struct list_head *next;
76 struct list_head *prev;
79 +# undef __need_list_t
86 /* Define a variable with the head and tail of the list. */
87 -#define LIST_HEAD(name) \
88 +# define LIST_HEAD(name) \
89 list_t name = { &(name), &(name) }
91 /* Initialize a new list head. */
92 -#define INIT_LIST_HEAD(ptr) \
93 +# define INIT_LIST_HEAD(ptr) \
94 (ptr)->next = (ptr)->prev = (ptr)
97 @@ -49,6 +61,7 @@ list_add (list_t *newp, list_t *head)
98 newp->next = head->next;
100 head->next->prev = newp;
101 + atomic_write_barrier ();
105 @@ -78,26 +91,28 @@ list_splice (list_t *add, list_t *head)
108 /* Get typed element from list at a given position. */
109 -#define list_entry(ptr, type, member) \
110 +# define list_entry(ptr, type, member) \
111 ((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member)))
115 /* Iterate forward over the elements of the list. */
116 -#define list_for_each(pos, head) \
117 +# define list_for_each(pos, head) \
118 for (pos = (head)->next; pos != (head); pos = pos->next)
121 /* Iterate forward over the elements of the list. */
122 -#define list_for_each_prev(pos, head) \
123 +# define list_for_each_prev(pos, head) \
124 for (pos = (head)->prev; pos != (head); pos = pos->prev)
127 /* Iterate backwards over the elements list. The list elements can be
128 removed from the list while doing this. */
129 -#define list_for_each_prev_safe(pos, p, head) \
130 +# define list_for_each_prev_safe(pos, p, head) \
131 for (pos = (head)->prev, p = pos->prev; \
133 pos = p, p = pos->prev)
135 +#endif /* _LIST_H */
138 Index: glibc-2.12-2-gc4ccff1/nptl_db/thread_dbP.h
139 ===================================================================
140 --- glibc-2.12-2-gc4ccff1.orig/nptl_db/thread_dbP.h
141 +++ glibc-2.12-2-gc4ccff1/nptl_db/thread_dbP.h
143 #include "proc_service.h"
144 #include "thread_db.h"
145 #include "../nptl/pthreadP.h" /* This is for *_BITMASK only. */
148 /* Indeces for the symbol names. */