xref: /onnv-gate/usr/src/uts/intel/sys/synch32.h (revision 5629)
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 /*
234570Sraf  * Copyright 2007 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 */
440Sstevel@tonic-gate #define	mutex_lockword		lock.lock32.lockword /* address of */
450Sstevel@tonic-gate #define	mutex_lockw		lock.lock64.pad[7]
460Sstevel@tonic-gate #define	mutex_waiters		lock.lock64.pad[6]
47*5629Sraf #define	mutex_spinners		lock.lock64.pad[5]
480Sstevel@tonic-gate 
490Sstevel@tonic-gate /* process-shared lock owner pid */
500Sstevel@tonic-gate #define	mutex_ownerpid		lock.lock32.ownerpid
510Sstevel@tonic-gate 
520Sstevel@tonic-gate /* Max. recusrion count for recursive mutexes */
530Sstevel@tonic-gate #define	RECURSION_MAX		255
540Sstevel@tonic-gate 
550Sstevel@tonic-gate /* special defines for LWP condition variables */
560Sstevel@tonic-gate #define	cond_type		flags.type
570Sstevel@tonic-gate #define	cond_magic		flags.magic
580Sstevel@tonic-gate #define	cond_clockid		flags.flag[1]
590Sstevel@tonic-gate #define	cond_waiters_user	flags.flag[2]
600Sstevel@tonic-gate #define	cond_waiters_kernel	flags.flag[3]
610Sstevel@tonic-gate 
620Sstevel@tonic-gate /* special defines for LWP semaphores */
630Sstevel@tonic-gate #define	sema_count		count
640Sstevel@tonic-gate #define	sema_type		type
650Sstevel@tonic-gate #define	sema_waiters		flags[7]
660Sstevel@tonic-gate 
670Sstevel@tonic-gate /* special defines for LWP rwlocks */
680Sstevel@tonic-gate #define	rwlock_readers		readers
690Sstevel@tonic-gate #define	rwlock_type		type
700Sstevel@tonic-gate #define	rwlock_magic		magic
710Sstevel@tonic-gate #define	rwlock_owner		readercv.data
720Sstevel@tonic-gate #define	rwlock_ownerpid		writercv.data
730Sstevel@tonic-gate 
740Sstevel@tonic-gate #define	URW_HAS_WAITERS		0x80000000
754570Sraf #define	URW_WRITE_LOCKED	0x40000000
764570Sraf #define	URW_READERS_MASK	0x3fffffff
770Sstevel@tonic-gate 
780Sstevel@tonic-gate #ifdef	__cplusplus
790Sstevel@tonic-gate }
800Sstevel@tonic-gate #endif
810Sstevel@tonic-gate 
820Sstevel@tonic-gate #endif /* _SYS_SYNCH32_H */
83