]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/mips/nptl/bits/pthreadtypes-arch.h
Split up endian.h to minimize exposure of BYTE_ORDER.
[thirdparty/glibc.git] / sysdeps / mips / nptl / bits / pthreadtypes-arch.h
CommitLineData
eab380d8 1/* Machine-specific pthread type layouts. MIPS version.
04277e02 2 Copyright (C) 2005-2019 Free Software Foundation, Inc.
eab380d8
AZ
3 This file is part of the GNU C Library.
4
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.
9
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.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
5a82c748 17 <https://www.gnu.org/licenses/>. */
eab380d8
AZ
18
19#ifndef _BITS_PTHREADTYPES_ARCH_H
20#define _BITS_PTHREADTYPES_ARCH_H 1
21
aa706e13 22#include <bits/endian.h>
eab380d8
AZ
23
24#if _MIPS_SIM == _ABI64
25# define __SIZEOF_PTHREAD_ATTR_T 56
26# define __SIZEOF_PTHREAD_MUTEX_T 40
27# define __SIZEOF_PTHREAD_RWLOCK_T 56
28# define __SIZEOF_PTHREAD_BARRIER_T 32
29#else
30# define __SIZEOF_PTHREAD_ATTR_T 36
31# define __SIZEOF_PTHREAD_MUTEX_T 24
32# define __SIZEOF_PTHREAD_RWLOCK_T 32
33# define __SIZEOF_PTHREAD_BARRIER_T 20
34#endif
35#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
36#define __SIZEOF_PTHREAD_COND_T 48
37#define __SIZEOF_PTHREAD_CONDATTR_T 4
38#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
39#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
40
41/* Data structure for mutex handling. */
42#define __PTHREAD_COMPAT_PADDING_MID
43#define __PTHREAD_COMPAT_PADDING_END
44#define __PTHREAD_MUTEX_LOCK_ELISION 0
06be6368
AZ
45#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND (_MIPS_SIM != _ABI64)
46#define __PTHREAD_MUTEX_USE_UNION (_MIPS_SIM != _ABI64)
eab380d8
AZ
47
48#define __LOCK_ALIGNMENT
49#define __ONCE_ALIGNMENT
50
51struct __pthread_rwlock_arch_t
52{
53 unsigned int __readers;
54 unsigned int __writers;
55 unsigned int __wrphase_futex;
56 unsigned int __writers_futex;
57 unsigned int __pad3;
58 unsigned int __pad4;
59#if _MIPS_SIM == _ABI64
60 int __cur_writer;
61 int __shared;
62 unsigned long int __pad1;
63 unsigned long int __pad2;
64 /* FLAGS must stay at this position in the structure to maintain
65 binary compatibility. */
66 unsigned int __flags;
67# else
68# if __BYTE_ORDER == __BIG_ENDIAN
69 unsigned char __pad1;
70 unsigned char __pad2;
71 unsigned char __shared;
72 /* FLAGS must stay at this position in the structure to maintain
73 binary compatibility. */
74 unsigned char __flags;
75# else
76 /* FLAGS must stay at this position in the structure to maintain
77 binary compatibility. */
78 unsigned char __flags;
79 unsigned char __shared;
80 unsigned char __pad1;
81 unsigned char __pad2;
82# endif
83 int __cur_writer;
84#endif
85};
86
87#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
88
89#endif /* bits/pthreadtypes.h */