diff options
author | jmb <jmb@FreeBSD.org> | 2000-01-16 02:10:21 +0000 |
---|---|---|
committer | jmb <jmb@FreeBSD.org> | 2000-01-16 02:10:21 +0000 |
commit | 23e040daad63ada91f91fff446d0877af2f2d875 (patch) | |
tree | ad8d787dfbee81f8d13827f8b7858f5cc89b3c48 /sys/i386/isa/ipl_funcs.c | |
parent | d2c03ae081425f7a76873336abbec1828b0539e7 (diff) | |
download | FreeBSD-src-23e040daad63ada91f91fff446d0877af2f2d875.zip FreeBSD-src-23e040daad63ada91f91fff446d0877af2f2d875.tar.gz |
Add SPLASSERT() macro. SPLASSERT() compiles to a no-op
unless both "option INVARIANTS" and "options INVARIANT_SUPPORT"
are defined in the kernel's config(8) file.
SPLASSERT(expression, msg) used KASSERT to check that the
expression is true, panic()ing the kernel otherwise.
Approved by: jkh
Reviewed by: jdp, dfr, phk, eivind and green
Diffstat (limited to 'sys/i386/isa/ipl_funcs.c')
-rw-r--r-- | sys/i386/isa/ipl_funcs.c | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/sys/i386/isa/ipl_funcs.c b/sys/i386/isa/ipl_funcs.c index 78b1c1d..5a305ec 100644 --- a/sys/i386/isa/ipl_funcs.c +++ b/sys/i386/isa/ipl_funcs.c @@ -67,14 +67,19 @@ softclockpending(void) #ifndef SMP -#define GENSPL(NAME, OP, MODIFIER, PC) \ -unsigned NAME(void) \ -{ \ - unsigned x; \ - \ - x = cpl; \ - cpl OP MODIFIER; \ - return (x); \ +#define GENSPL(NAME, OP, MODIFIER, PC) \ +unsigned NAME(void) \ +{ \ + unsigned x; \ + \ + x = cpl; \ + cpl OP MODIFIER; \ + return (x); \ +} \ +int \ +is_##NAME(void) \ +{ \ + return ((cpl & (MODIFIER)) == (MODIFIER)); \ } void @@ -186,23 +191,35 @@ unsigned NAME(void) \ IFCPL_UNLOCK(); \ \ return (x); \ +} \ +int \ +is_##NAME(void) \ +{ \ + return ((cpl & (MODIFIER)) == (MODIFIER)); \ } + #else /* INTR_SPL */ -#define GENSPL(NAME, OP, MODIFIER, PC) \ -unsigned NAME(void) \ -{ \ - unsigned x; \ - \ - IFCPL_LOCK(); \ - x = cpl; \ - cpl OP MODIFIER; \ - IFCPL_UNLOCK(); \ - \ - return (x); \ +#define GENSPL(NAME, OP, MODIFIER, PC) \ +unsigned NAME(void) \ +{ \ + unsigned x; \ + \ + IFCPL_LOCK(); \ + x = cpl; \ + cpl OP MODIFIER; \ + IFCPL_UNLOCK(); \ + \ + return (x); \ +} \ +int \ +is_##NAME(void) \ +{ \ + return ((cpl & (MODIFIER)) == (MODIFIER)); \ } + #endif /* INTR_SPL */ |