xref: /original-bsd/sys/hp300/include/psl.h (revision 03bd62d7)
1 /*
2  * Copyright (c) 1982, 1986 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)psl.h	7.4 (Berkeley) 12/27/92
8  */
9 
10 #ifndef PSL_C
11 /*
12  * MC68000 program status word
13  */
14 
15 #define	PSL_C		0x0001		/* carry bit */
16 #define	PSL_V		0x0002		/* overflow bit */
17 #define	PSL_Z		0x0004		/* zero bit */
18 #define	PSL_N		0x0008		/* negative bit */
19 #define	PSL_X		0x0010		/* extend bit */
20 #define	PSL_ALLCC	0x001F		/* all cc bits - unlikely */
21 #define	PSL_IPL0	0x0000		/* interrupt priority level 0 */
22 #define	PSL_IPL1	0x0100		/* interrupt priority level 1 */
23 #define	PSL_IPL2	0x0200		/* interrupt priority level 2 */
24 #define	PSL_IPL3	0x0300		/* interrupt priority level 3 */
25 #define	PSL_IPL4	0x0400		/* interrupt priority level 4 */
26 #define	PSL_IPL5	0x0500		/* interrupt priority level 5 */
27 #define	PSL_IPL6	0x0600		/* interrupt priority level 6 */
28 #define	PSL_IPL7	0x0700		/* interrupt priority level 7 */
29 #define	PSL_M		0x1000		/* master (kernel) sp vs intr sp */
30 #define	PSL_S		0x2000		/* supervisor enable bit */
31 /*	PSL_T0		0x4000		   ??? T0 on 68020, 8000 is T1 */
32 #define	PSL_T		0x8000		/* trace enable bit */
33 
34 #define	PSL_LOWIPL	(PSL_S)
35 #define	PSL_HIGHIPL	(PSL_S | PSL_IPL7)
36 #define PSL_IPL		(PSL_IPL7)
37 #define	PSL_USER	(0)
38 
39 #define	PSL_MBZ		0xFFFF58E0	/* must be zero bits */
40 
41 #define	PSL_USERSET	(0)
42 #define	PSL_USERCLR	(PSL_S | PSL_IPL7 | PSL_MBZ)
43 
44 #define	USERMODE(ps)	(((ps) & PSL_S) == 0)
45 #endif
46