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
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
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
46 /* Thread identifiers. The structure of the attribute type is
47 deliberately not exposed. */
48 typedef unsigned long int pthread_t
;
53 char __size
[__SIZEOF_PTHREAD_ATTR_T
];
58 /* Data structures for mutex handling. The structure of the attribute
59 type is deliberately not exposed. */
62 struct __pthread_mutex_s
67 #if _MIPS_SIM == _ABI64
68 unsigned int __nusers
;
70 /* KIND must stay at this position in the structure to maintain
71 binary compatibility. */
73 #if _MIPS_SIM == _ABI64
75 struct __pthread_mutex_s
*__next
;
76 struct __pthread_mutex_s
*__prev
;
77 # define __PTHREAD_MUTEX_HAVE_PREV 1
79 unsigned int __nusers
;
83 struct __pthread_mutex_s
*__next
;
87 char __size
[__SIZEOF_PTHREAD_MUTEX_T
];
93 char __size
[__SIZEOF_PTHREAD_MUTEXATTR_T
];
95 } pthread_mutexattr_t
;
98 /* Data structure for conditional variable handling. The structure of
99 the attribute type is deliberately not exposed. */
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
;
110 unsigned int __nwaiters
;
111 unsigned int __broadcast_seq
;
113 char __size
[__SIZEOF_PTHREAD_COND_T
];
114 __extension__
long long int __align
;
119 char __size
[__SIZEOF_PTHREAD_CONDATTR_T
];
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. */
137 # if _MIPS_SIM == _ABI64
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
;
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
;
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
;
169 char __size
[__SIZEOF_PTHREAD_RWLOCK_T
];
175 char __size
[__SIZEOF_PTHREAD_RWLOCKATTR_T
];
177 } pthread_rwlockattr_t
;
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. */
190 char __size
[__SIZEOF_PTHREAD_BARRIER_T
];
196 char __size
[__SIZEOF_PTHREAD_BARRIERATTR_T
];
198 } pthread_barrierattr_t
;
202 #endif /* bits/pthreadtypes.h */