xref: /onnv-gate/usr/src/uts/intel/sys/synch32.h (revision 6057:275ef2021819)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
54570Sraf  * Common Development and Distribution License (the "License").
64570Sraf  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
214570Sraf 
220Sstevel@tonic-gate /*
23*6057Sraf  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef _SYS_SYNCH32_H
280Sstevel@tonic-gate #define	_SYS_SYNCH32_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #ifdef	__cplusplus
330Sstevel@tonic-gate extern "C" {
340Sstevel@tonic-gate #endif
350Sstevel@tonic-gate 
360Sstevel@tonic-gate /* special defines for LWP mutexes */
370Sstevel@tonic-gate #define	mutex_flag		flags.flag1
380Sstevel@tonic-gate #define	mutex_ceiling		flags.ceiling
390Sstevel@tonic-gate #define	mutex_type		flags.mbcp_type_un.mtype_rcount.count_type1
400Sstevel@tonic-gate #define	mutex_rcount		flags.mbcp_type_un.mtype_rcount.count_type2
410Sstevel@tonic-gate #define	mutex_magic		flags.magic
420Sstevel@tonic-gate #define	mutex_owner		data
430Sstevel@tonic-gate /* used to atomically operate on whole word via cas or swap instruction */
44*6057Sraf #define	mutex_lockword		lock.lock32.lockword
45*6057Sraf /* this requires cas64 */
46*6057Sraf #define	mutex_lockword64	lock.owner64
47*6057Sraf /* these are bytes */
480Sstevel@tonic-gate #define	mutex_lockw		lock.lock64.pad[7]
490Sstevel@tonic-gate #define	mutex_waiters		lock.lock64.pad[6]
505629Sraf #define	mutex_spinners		lock.lock64.pad[5]
510Sstevel@tonic-gate 
520Sstevel@tonic-gate /* process-shared lock owner pid */
530Sstevel@tonic-gate #define	mutex_ownerpid		lock.lock32.ownerpid
540Sstevel@tonic-gate 
550Sstevel@tonic-gate /* Max. recusrion count for recursive mutexes */
560Sstevel@tonic-gate #define	RECURSION_MAX		255
570Sstevel@tonic-gate 
580Sstevel@tonic-gate /* special defines for LWP condition variables */
590Sstevel@tonic-gate #define	cond_type		flags.type
600Sstevel@tonic-gate #define	cond_magic		flags.magic
610Sstevel@tonic-gate #define	cond_clockid		flags.flag[1]
620Sstevel@tonic-gate #define	cond_waiters_user	flags.flag[2]
630Sstevel@tonic-gate #define	cond_waiters_kernel	flags.flag[3]
640Sstevel@tonic-gate 
650Sstevel@tonic-gate /* special defines for LWP semaphores */
660Sstevel@tonic-gate #define	sema_count		count
670Sstevel@tonic-gate #define	sema_type		type
680Sstevel@tonic-gate #define	sema_waiters		flags[7]
690Sstevel@tonic-gate 
700Sstevel@tonic-gate /* special defines for LWP rwlocks */
710Sstevel@tonic-gate #define	rwlock_readers		readers
720Sstevel@tonic-gate #define	rwlock_type		type
730Sstevel@tonic-gate #define	rwlock_magic		magic
740Sstevel@tonic-gate #define	rwlock_owner		readercv.data
750Sstevel@tonic-gate #define	rwlock_ownerpid		writercv.data
760Sstevel@tonic-gate 
770Sstevel@tonic-gate #define	URW_HAS_WAITERS		0x80000000
784570Sraf #define	URW_WRITE_LOCKED	0x40000000
794570Sraf #define	URW_READERS_MASK	0x3fffffff
800Sstevel@tonic-gate 
810Sstevel@tonic-gate #ifdef	__cplusplus
820Sstevel@tonic-gate }
830Sstevel@tonic-gate #endif
840Sstevel@tonic-gate 
850Sstevel@tonic-gate #endif /* _SYS_SYNCH32_H */
86