Amend log entry with omitted file.
[glibc.git] / nptl / sysdeps / unix / sysv / linux / mips / bits / pthreadtypes.h
blobd5e89a9364b7902b4bf8e6627fee14faf0655a4d
1 /* Machine-specific pthread type layouts. MIPS version.
2 Copyright (C) 2005, 2006 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
20 #ifndef _BITS_PTHREADTYPES_H
21 #define _BITS_PTHREADTYPES_H 1
23 #if _MIPS_SIM == _ABI64
24 # define __SIZEOF_PTHREAD_ATTR_T 56
25 # define __SIZEOF_PTHREAD_MUTEX_T 40
26 # define __SIZEOF_PTHREAD_MUTEXATTR_T 4
27 # define __SIZEOF_PTHREAD_COND_T 48
28 # define __SIZEOF_PTHREAD_CONDATTR_T 4
29 # define __SIZEOF_PTHREAD_RWLOCK_T 56
30 # define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
31 # define __SIZEOF_PTHREAD_BARRIER_T 32
32 # define __SIZEOF_PTHREAD_BARRIERATTR_T 4
33 #else
34 # define __SIZEOF_PTHREAD_ATTR_T 36
35 # define __SIZEOF_PTHREAD_MUTEX_T 24
36 # define __SIZEOF_PTHREAD_MUTEXATTR_T 4
37 # define __SIZEOF_PTHREAD_COND_T 48
38 # define __SIZEOF_PTHREAD_CONDATTR_T 4
39 # define __SIZEOF_PTHREAD_RWLOCK_T 32
40 # define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
41 # define __SIZEOF_PTHREAD_BARRIER_T 20
42 # define __SIZEOF_PTHREAD_BARRIERATTR_T 4
43 #endif
46 /* Thread identifiers. The structure of the attribute type is
47 deliberately not exposed. */
48 typedef unsigned long int pthread_t;
51 typedef union
53 char __size[__SIZEOF_PTHREAD_ATTR_T];
54 long int __align;
55 } pthread_attr_t;
58 /* Data structures for mutex handling. The structure of the attribute
59 type is deliberately not exposed. */
60 typedef union
62 struct __pthread_mutex_s
64 int __lock;
65 unsigned int __count;
66 int __owner;
67 #if _MIPS_SIM == _ABI64
68 unsigned int __nusers;
69 #endif
70 /* KIND must stay at this position in the structure to maintain
71 binary compatibility. */
72 int __kind;
73 #if _MIPS_SIM == _ABI64
74 int __spins;
75 struct __pthread_mutex_s *__next;
76 struct __pthread_mutex_s *__prev;
77 # define __PTHREAD_MUTEX_HAVE_PREV 1
78 #else
79 unsigned int __nusers;
80 __extension__ union
82 int __spins;
83 struct __pthread_mutex_s *__next;
85 #endif
86 } __data;
87 char __size[__SIZEOF_PTHREAD_MUTEX_T];
88 long int __align;
89 } pthread_mutex_t;
91 typedef union
93 char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
94 int __align;
95 } pthread_mutexattr_t;
98 /* Data structure for conditional variable handling. The structure of
99 the attribute type is deliberately not exposed. */
100 typedef union
102 struct
104 int __lock;
105 unsigned int __futex;
106 __extension__ unsigned long long int __total_seq;
107 __extension__ unsigned long long int __wakeup_seq;
108 __extension__ unsigned long long int __woken_seq;
109 void *__mutex;
110 unsigned int __nwaiters;
111 unsigned int __broadcast_seq;
112 } __data;
113 char __size[__SIZEOF_PTHREAD_COND_T];
114 __extension__ long long int __align;
115 } pthread_cond_t;
117 typedef union
119 char __size[__SIZEOF_PTHREAD_CONDATTR_T];
120 int __align;
121 } pthread_condattr_t;
124 /* Keys for thread-specific data */
125 typedef unsigned int pthread_key_t;
128 /* Once-only execution */
129 typedef int pthread_once_t;
132 #if defined __USE_UNIX98 || defined __USE_XOPEN2K
133 /* Data structure for read-write lock variable handling. The
134 structure of the attribute type is deliberately not exposed. */
135 typedef union
137 # if _MIPS_SIM == _ABI64
138 struct
140 int __lock;
141 unsigned int __nr_readers;
142 unsigned int __readers_wakeup;
143 unsigned int __writer_wakeup;
144 unsigned int __nr_readers_queued;
145 unsigned int __nr_writers_queued;
146 int __writer;
147 int __pad1;
148 unsigned long int __pad2;
149 unsigned long int __pad3;
150 /* FLAGS must stay at this position in the structure to maintain
151 binary compatibility. */
152 unsigned int __flags;
153 } __data;
154 # else
155 struct
157 int __lock;
158 unsigned int __nr_readers;
159 unsigned int __readers_wakeup;
160 unsigned int __writer_wakeup;
161 unsigned int __nr_readers_queued;
162 unsigned int __nr_writers_queued;
163 /* FLAGS must stay at this position in the structure to maintain
164 binary compatibility. */
165 unsigned int __flags;
166 int __writer;
167 } __data;
168 # endif
169 char __size[__SIZEOF_PTHREAD_RWLOCK_T];
170 long int __align;
171 } pthread_rwlock_t;
173 typedef union
175 char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
176 long int __align;
177 } pthread_rwlockattr_t;
178 #endif
181 #ifdef __USE_XOPEN2K
182 /* POSIX spinlock data type. */
183 typedef volatile int pthread_spinlock_t;
186 /* POSIX barriers data type. The structure of the type is
187 deliberately not exposed. */
188 typedef union
190 char __size[__SIZEOF_PTHREAD_BARRIER_T];
191 long int __align;
192 } pthread_barrier_t;
194 typedef union
196 char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
197 int __align;
198 } pthread_barrierattr_t;
199 #endif
202 #endif /* bits/pthreadtypes.h */