Commit | Line | Data |
---|---|---|
88a7e859 | 1 | /* |
df7778ec KB |
2 | * Copyright (c) 1982, 1986, 1993 |
3 | * The Regents of the University of California. All rights reserved. | |
88a7e859 KM |
4 | * |
5 | * %sccs.include.redist.c% | |
6 | * | |
df7778ec | 7 | * @(#)psl.h 8.1 (Berkeley) %G% |
88a7e859 KM |
8 | */ |
9 | ||
5e634240 | 10 | #ifndef PSL_C |
88a7e859 KM |
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 */ | |
5975ff1d | 29 | #define PSL_M 0x1000 /* master (kernel) sp vs intr sp */ |
88a7e859 | 30 | #define PSL_S 0x2000 /* supervisor enable bit */ |
5975ff1d | 31 | /* PSL_T0 0x4000 ??? T0 on 68020, 8000 is T1 */ |
88a7e859 KM |
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 | ||
db1754fc | 39 | #define PSL_MBZ 0xFFFF58E0 /* must be zero bits */ |
88a7e859 KM |
40 | |
41 | #define PSL_USERSET (0) | |
42 | #define PSL_USERCLR (PSL_S | PSL_IPL7 | PSL_MBZ) | |
5e634240 | 43 | |
5e634240 | 44 | #define USERMODE(ps) (((ps) & PSL_S) == 0) |
5e634240 | 45 | #endif |