/* @(#) $Revision: 1.17.98.2 $ */      
/* $Source: /usr/local/kcs/sys.DAVIS_800/machine/RCS/psl.h,v $
 * $Revision: 1.17.98.2 $	$Author: shep $
 * $State: Exp $   	$Locker: BERT $
 * $Date: 96/02/09 16:03:51 $
 */
#ifndef _MACHINE_PSL_INCLUDED /* allow multiple inclusions */
#define _MACHINE_PSL_INCLUDED

/*
 * Processor Status Word (PSW) Masks
 * Berkeley UNIX calls this the processor status longword
 */

#define	PSW_CB_HI 0x000000ff	/* Upper Carry/Borrow Bits                  */
				/*  (in upper 32 bits of 64 bit doubleword) */
#define	PSW_T	0x01000000	/* Taken Branch Trap Enable */
#define	PSW_H	0x00800000	/* Higher-Privilege Transfer Trap Enable */
#define	PSW_L	0x00400000	/* Lower-Privilege Transfer Trap Enable */
#define	PSW_N	0x00200000	/* PC Queue Front Instruction Nullified */
#define	PSW_X	0x00100000	/* Data Memory Break Disable */
#define	PSW_B	0x00080000	/* Taken Branch in Previous Cycle */
#define	PSW_C	0x00040000	/* Code Address Translation Enable */
#define	PSW_V	0x00020000	/* Divide Step Correction */
#define	PSW_M	0x00010000	/* High-Priority Machine Check Disable */
#define	PSW_CB	0x0000ff00	/* Carry/Borrow Bits */
#define	PSW_R	0x00000010	/* Recovery Counter Enable */
#define	PSW_Q	0x00000008	/* Interruption State Collection Enable */
#define	PSW_P	0x00000004	/* Protection ID Validation Enable */
#define	PSW_D	0x00000002	/* Data Address Translation Enable */
#define	PSW_I	0x00000001	/* External, Power Failure, Low-Priority */
				/*  Machine Check Interruption Enable */

/*
 * PSW Bit Positions
 */

#define	PSW_T_P	7
#define	PSW_H_P	8
#define	PSW_L_P	9
#define	PSW_N_P	10
#define	PSW_X_P	11
#define	PSW_B_P	12
#define	PSW_C_P	13
#define	PSW_V_P	14
#define	PSW_M_P	15
#define	PSW_CB_P	23
#define	PSW_R_P	27
#define	PSW_Q_P	28
#define	PSW_P_P	29
#define	PSW_D_P	30
#define	PSW_I_P	31

/*
 * Kernel PSW Masks
 */
#define	SYSTEM_MASK	(PSW_R+PSW_Q+PSW_P+PSW_D+PSW_I)
#ifndef __BTT
#define	GLOBAL_VAR_MASK	(PSW_H+PSW_L+PSW_C+PSW_M)
#else /* not __BTT */
#define	GLOBAL_VAR_MASK	(PSW_H+PSW_L+PSW_C+PSW_M+PSW_T)
#endif /* not __BTT */
#define	SAVE_STATE_MASK_HI (PSW_CB_HI)
#define	SAVE_STATE_MASK	(PSW_X+PSW_T+PSW_N+PSW_B+PSW_V+PSW_CB)
#define	PTRACE_MASK	(PSW_N+PSW_V+PSW_CB)

#endif /* _MACHINE_PSL_INCLUDED */
