]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/hppa/nptl/bits/pthreadtypes-arch.h
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / hppa / nptl / bits / pthreadtypes-arch.h
1 /* Copyright (C) 2005-2019 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library. If not, see
16 <https://www.gnu.org/licenses/>. */
17
18 #ifndef _BITS_PTHREADTYPES_ARCH_H
19 #define _BITS_PTHREADTYPES_ARCH_H 1
20
21 /* Linuxthread type sizes (bytes):
22 sizeof(pthread_attr_t) = 0x24 (36)
23 sizeof(pthread_barrier_t) = 0x30 (48)
24 sizeof(pthread_barrierattr_t) = 0x4 (4)
25 sizeof(pthread_cond_t) = 0x30 (48)
26 sizeof(pthread_condattr_t) = 0x4 (4)
27 sizeof(pthread_mutex_t) = 0x30 (48)
28 sizeof(pthread_mutexattr_t) = 0x4 (4)
29 sizeof(pthread_rwlock_t) = 0x40 (64)
30 sizeof(pthread_rwlockattr_t) = 0x8 (8)
31 sizeof(pthread_spinlock_t) = 0x10 (16) */
32
33 #define __SIZEOF_PTHREAD_ATTR_T 36
34 #define __SIZEOF_PTHREAD_MUTEX_T 48
35 #define __SIZEOF_PTHREAD_BARRIER_T 48
36 #define __SIZEOF_PTHREAD_BARRIERATTR_T 4
37 #define __SIZEOF_PTHREAD_COND_T 48
38 #define __SIZEOF_PTHREAD_CONDATTR_T 4
39 #define __SIZEOF_PTHREAD_MUTEXATTR_T 4
40 #define __SIZEOF_PTHREAD_RWLOCK_T 64
41 #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
42
43 /* The old 4-word 16-byte aligned lock. This is initalized
44 to all ones by the Linuxthreads PTHREAD_MUTEX_INITIALIZER.
45 Unused in NPTL. */
46 #define __PTHREAD_COMPAT_PADDING_MID int __compat_padding[4];
47 /* Two more words are left before the NPTL
48 pthread_mutex_t is larger than Linuxthreads. */
49 #define __PTHREAD_COMPAT_PADDING_END int __reserved[2];
50 #define __PTHREAD_MUTEX_LOCK_ELISION 0
51 #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 1
52 #define __PTHREAD_MUTEX_USE_UNION 1
53
54 #define __LOCK_ALIGNMENT __attribute__ ((__aligned__(16)))
55 #define __ONCE_ALIGNMENT
56
57 struct __pthread_rwlock_arch_t
58 {
59 /* In the old Linuxthreads pthread_rwlock_t, this is the
60 start of the 4-word 16-byte aligned lock structure. The
61 next four words are all set to 1 by the Linuxthreads
62 PTHREAD_RWLOCK_INITIALIZER. We ignore them in NPTL. */
63 int __compat_padding[4] __attribute__ ((__aligned__(16)));
64 unsigned int __readers;
65 unsigned int __writers;
66 unsigned int __wrphase_futex;
67 unsigned int __writers_futex;
68 unsigned int __pad3;
69 unsigned int __pad4;
70 int __cur_writer;
71 /* An unused word, reserved for future use. It was added
72 to maintain the location of the flags from the Linuxthreads
73 layout of this structure. */
74 int __reserved1;
75 /* FLAGS must stay at this position in the structure to maintain
76 binary compatibility. */
77 unsigned char __pad2;
78 unsigned char __pad1;
79 unsigned char __shared;
80 unsigned char __flags;
81 /* The NPTL pthread_rwlock_t is 4 words smaller than the
82 Linuxthreads version. One word is in the middle of the
83 structure, the other three are at the end. */
84 int __reserved2;
85 int __reserved3;
86 int __reserved4;
87 };
88
89 #define __PTHREAD_RWLOCK_ELISION_EXTRA 0
90
91 #endif /* bits/pthreadtypes.h */