summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86/synchP.h
blob: 38d76a473a32f1e533b2449c3ae7c74554928faf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* Copyright (C) 2008 Free Software Foundation, Inc.
   This file is part of the GNU C Library.
   Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

#ifndef _SYNCH_PRIV_H
#define _SYNCH_PRIV_H

/* mutex helper macros */
#define mutex_type              flags.mbcp_type_un.mtype_rcount.count_type1
#define mutex_magic             flags.magic
#define mutex_flag              flags.flag1
#define mutex_ceiling           flags.ceiling
#define mutex_real_ceiling      flags.flag2 /* Non-standard; see NOTES.opensolaris */
#define mutex_rcount            flags.mbcp_type_un.mtype_rcount.count_type2
#define mutex_owner             data.data32.owner
#define mutex_lockword32        lock.lock32.lockword
#define mutex_lockword64        lock.owner64
#define mutex_lockbyte          lock.lock64.pad[7]
#define mutex_waiters           lock.lock64.pad[6]
#define mutex_cond_waiters      data.data32.cond_waiters
#define mutex_ownerpid          lock.lock32.ownerpid
#define RECURSION_MAX           255 /* UCHAR_MAX */
#define LOCKBYTE_SET            0x01
#define LOCKBYTE_UNSET          0x00
#define LOCKWORD32_SET_NO_WAITERS       0x01000000
#define LOCKWORD32_UNSET_NO_WAITERS     0x00000000
#define LOCKWORD64_SET_NO_WAITERS       0x0100000000000000
#define LOCKWORD64_UNSET_NO_WAITERS     0x0000000000000000
#define MUTEX_OWNERPID_SHIFT    0

/* condition variable helper macros */
#define cond_type               flags.type
#define cond_magic              flags.magic
#define cond_clockid            flags.flag[1]
#define cond_waiters_user       flags.flag[2]
#define cond_waiters_kernel     flags.flag[3]

/* semaphore helper macros */
#define sema_count              count
#define sema_type               type
#define sema_waiters            flags[7]

#endif /* _SYNCH_PRIV_H */