/* <lckdef.h>
 *
 *	Lock manager definitions
 */
#ifndef _LCKDEF_H
#define _LCKDEF_H

#define LCK$V_VALBLK	0
#define LCK$V_CONVERT	1
#define LCK$V_NOQUEUE	2
#define LCK$V_SYNCSTS	3
#define LCK$V_SYSTEM	4
#define LCK$V_NOQUOTA	5
#define LCK$V_CVTSYS	6
#define LCK$V_RECOVER	7
#define LCK$V_PROTECT	8
#define LCK$V_NODLCKWT	9
#define LCK$V_NODLCKBLK 10
#define LCK$V_EXPEDITE	11
#define LCK$V_QUECVT	12
#define LCK$V_BYPASS	13
#define LCK$M_VALBLK	(1<<LCK$V_VALBLK)	/* 0x01 */
#define LCK$M_CONVERT	(1<<LCK$V_CONVERT)	/* 0x02 */
#define LCK$M_NOQUEUE	(1<<LCK$V_NOQUEUE)	/* 0x04 */
#define LCK$M_SYNCSTS	(1<<LCK$V_SYNCSTS)	/* 0x08 */
#define LCK$M_SYSTEM	(1<<LCK$V_SYSTEM)	/* 0x10 */
#define LCK$M_NOQUOTA	(1<<LCK$V_NOQUOTA)	/* 0x20 */
#define LCK$M_CVTSYS	(1<<LCK$V_CVTSYS)	/* 0x40 */
#define LCK$M_RECOVER	(1<<LCK$V_RECOVER)	/* 0x80 */
#define LCK$M_PROTECT	(1<<LCK$V_PROTECT)	/* 0x0100 */
#define LCK$M_NODLCKWT	(1<<LCK$V_NODLCKWT)	/* 0x0200 */
#define LCK$M_NODLCKBLK (1<<LCK$V_NODLCKBLK)	/* 0x0400 */
#define LCK$M_EXPEDITE	(1<<LCK$V_EXPEDITE)	/* 0x0800 */
#define LCK$M_QUECVT	(1<<LCK$V_QUECVT)	/* 0x1000 */
#define LCK$M_BYPASS	(1<<LCK$V_BYPASS)	/* 0x2000 */

#define LCK$V_DEQALL	0x01
#define LCK$V_CANCEL	0x02
#define LCK$V_INVVALBLK 0x04
#define LCK$M_DEQALL	(1<<LCK$V_DEQALL)	/* 0x01 */
#define LCK$M_CANCEL	(1<<LCK$V_CANCEL)	/* 0x02 */
#define LCK$M_INVVALBLK (1<<LCK$V_INVVALBLK)	/* 0x04 */

/* lock modes */
#define LCK$K_NLMODE	0	/* null */
#define LCK$K_CRMODE	1	/* concurrent read */
#define LCK$K_CWMODE	2	/* concurrent write */
#define LCK$K_PRMODE	3	/* protected read */
#define LCK$K_PWMODE	4	/* protected write */
#define LCK$K_EXMODE	5	/* exclusive */
union lckdef {
    struct {
	unsigned lck$v_valblk	: 1;	/* value block included */
	unsigned lck$v_convert	: 1;	/* conversion request */
	unsigned lck$v_noqueue	: 1;	/* do not queue request */
	unsigned lck$v_syncsts	: 1;	/* synchronous status requested */
	unsigned lck$v_system	: 1;	/* system lock */
	unsigned lck$v_noquota	: 1;	/* don't charge quota */
	unsigned lck$v_cvtsys	: 1;	/* convert to system */
	unsigned lck$v_recover	: 1;	/* recover lock during failover */
	unsigned lck$v_protect	: 1;	/* protect lock during failover */
	unsigned lck$v_nodlckwt : 1;	/* no deadlock waiting */
	unsigned lck$v_nodlckblk: 1;	/* no deadlock blocking */
	unsigned lck$v_expedite : 1;	/* expedite nlmode request */
	unsigned lck$v_quecvt	: 1;	/* force conversion to queue */
	unsigned lck$v_bypass	: 1;	/* bypass waiting requests */
	unsigned		: 2;
    } lck$r_lckdef_bits0;
    struct {
	unsigned lck$v_deqall	: 1;	/* dequeue all locks */
	unsigned lck$v_cancel	: 1;	/* cancel request */
	unsigned lck$v_invvalblk: 1;	/* invalidate value block */
	unsigned		: 5;
    } lck$r_lckdef_bits1;
};

#endif	/*_LCKDEF_H*/
