/* <vms/lib/wsldef.h>
 *
 *	LIB - working set list definitions		[not in Starlet]
 */
#ifndef _WSLDEF_H
#define _WSLDEF_H

#define WSL$V_VALID	0
#define WSL$M_VALID	(1<<WSL$V_VALID)	/* 0x01 */
#define WSL$V_PAGTYP	1
#define WSL$M_PAGTYP	0x0E
#define WSL$S_PAGTYP	3
#define WSL$V_PFNLOCK	4
#define WSL$V_WSLOCK	5
#define WSL$V_GOODPAGE	6
#define WSL$V_MODIFY	8
#define WSL$M_PFNLOCK	(1<<WSL$V_PFNLOCK)	/* 0x10 */
#define WSL$M_WSLOCK	(1<<WSL$V_WSLOCK)	/* 0x20 */
#define WSL$M_GOODPAGE	(1<<WSL$V_GOODPAGE)	/* 0x40 */
#define WSL$M_MODIFY	(1<<WSL$V_MODIFY)	/* 0x0100 */
#define WSL$V_OFFSET	9
#define WSL$M_OFFSET	0x7FFFFE00
#define WSL$S_OFFSET	22

#define WSL$C_LENGTH	4	/* size of WS list entry */
/*
   page type vield definitions

   N.B.:  These constants have been adjusted by left-shifting the
	  constant by the offset to the field WSL$V_PAGTYP.
	  To use these when explicitly extracting the field, the
	  adjustment must be removed. For example:
	   if ( wsle.wsl$v_pagtyp == (WSL$C_SYSTEM>>1) )  ...;
 */
#define WSL$C_PROCESS	0	/* PROCESS PAGE */
#define WSL$C_SYSTEM	2	/* SYSTEM PAGE */
#define WSL$C_GLOBAL	4	/* GLOBAL PAGE (READ ONLY) */
#define WSL$C_GBLWRT	6	/* GLOBAL WRITABLE PAGE */
#define WSL$C_PPGTBL	8	/* PROCESS PAGE TABLE */
#define WSL$C_GPGTBL	10	/* GLOBAL PAGE TABLE */

#ifndef NO_VMS_V6
#define WSL$S_WSLDEF	4
#else
#define WSL$S_WSLDEF	2
#endif
union wsldef {
    unsigned short wsl$w_wsldef;
    struct {
	unsigned wsl$v_valid	: 1;	/* WSL entry valid */
	unsigned wsl$v_pagtyp	: 3;	/* page type (see PFNDEF for values) */
	unsigned wsl$v_pfnlock	: 1;	/* page frame lock */
	unsigned wsl$v_wslock	: 1;	/* working set lock */
	unsigned wsl$v_goodpage : 1;	/* this page should remain in WS one more pass */
	unsigned		: 1;
	unsigned wsl$v_modify	: 1;	/* saved modify bit */
#ifndef NO_VMS_V6
	unsigned wsl$v_offset	: 22;	/* WSLE offset */
	unsigned		: 1;	/* padding */
#else
	unsigned		: 7;	/* padding */
#endif
    } wsl$r_wsldef_bits;
};

#endif	/*_WSLDEF_H*/
