| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: psl.h,v 1.18 2024/01/14 22:06:03 thorpej Exp $ */ | | 1 | /* $NetBSD: psl.h,v 1.19 2024/01/16 05:29:44 thorpej Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1982, 1986, 1993 | | 4 | * Copyright (c) 1982, 1986, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -55,26 +55,29 @@ | | | @@ -55,26 +55,29 @@ |
55 | /* PSL_T0 0x4000 ??? T0 on 68020, 8000 is T1 */ | | 55 | /* PSL_T0 0x4000 ??? T0 on 68020, 8000 is T1 */ |
56 | #define PSL_T 0x8000 /* trace enable bit */ | | 56 | #define PSL_T 0x8000 /* trace enable bit */ |
57 | | | 57 | |
58 | #define PSL_LOWIPL (PSL_S) | | 58 | #define PSL_LOWIPL (PSL_S) |
59 | #define PSL_HIGHIPL (PSL_S | PSL_IPL7) | | 59 | #define PSL_HIGHIPL (PSL_S | PSL_IPL7) |
60 | #define PSL_IPL (PSL_IPL7) | | 60 | #define PSL_IPL (PSL_IPL7) |
61 | #define PSL_USER (0) | | 61 | #define PSL_USER (0) |
62 | | | 62 | |
63 | #define PSL_MBZ 0xFFFF58E0 /* must be zero bits */ | | 63 | #define PSL_MBZ 0xFFFF58E0 /* must be zero bits */ |
64 | | | 64 | |
65 | #define PSL_USERSET (0) | | 65 | #define PSL_USERSET (0) |
66 | #define PSL_USERCLR (PSL_S | PSL_IPL7 | PSL_MBZ) | | 66 | #define PSL_USERCLR (PSL_S | PSL_IPL7 | PSL_MBZ) |
67 | | | 67 | |
| | | 68 | #define PSLTOIPL(x) (((x) >> 8) & 0x7) |
| | | 69 | #define IPLTOPSL(x) ((((x) & 0x7) << 8) | PSL_S) |
| | | 70 | |
68 | #define USERMODE(ps) (((ps) & PSL_S) == 0) | | 71 | #define USERMODE(ps) (((ps) & PSL_S) == 0) |
69 | | | 72 | |
70 | #if defined(_KERNEL) && !defined(_LOCORE) | | 73 | #if defined(_KERNEL) && !defined(_LOCORE) |
71 | | | 74 | |
72 | #define IPL_SAFEPRI PSL_LOWIPL /* for kern_sleepq.c */ | | 75 | #define IPL_SAFEPRI PSL_LOWIPL /* for kern_sleepq.c */ |
73 | | | 76 | |
74 | /* | | 77 | /* |
75 | * spl functions; platform-specific code must define spl0 and splx(). | | 78 | * spl functions; platform-specific code must define spl0 and splx(). |
76 | */ | | 79 | */ |
77 | | | 80 | |
78 | static inline int | | 81 | static inline int |
79 | getsr(void) | | 82 | getsr(void) |
80 | { | | 83 | { |