summaryrefslogtreecommitdiffstats
path: root/sys/ia64/include/cpu.h
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-09-19 07:48:22 +0000
committermarcel <marcel@FreeBSD.org>2003-09-19 07:48:22 +0000
commit758f95abc69f45ea012ea1848903bf92b5361f92 (patch)
treec54784b172ef17bce1cc678e9ba49f6a07ffa59f /sys/ia64/include/cpu.h
parent620ea1ef61b7d61628f17672f8160bac30fe640d (diff)
downloadFreeBSD-src-758f95abc69f45ea012ea1848903bf92b5361f92.zip
FreeBSD-src-758f95abc69f45ea012ea1848903bf92b5361f92.tar.gz
Change TRAPF_USERMODE and CLOCKF_USERMODE to not test for CPL == 3,
but for CPL != 0. For some reason yet unknown it is possible for the CPL to be 2. This would previously be counted as kernel mode, which resulted in nasty panics. By changing the test it is now treated as user mode, which is more correct. We still need to figure out how it is possible that the privilege level can be 2 (or 1 for that matter), because it's not used by us. We only use 3 (user mode) and 0 (kernel mode).
Diffstat (limited to 'sys/ia64/include/cpu.h')
-rw-r--r--sys/ia64/include/cpu.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ia64/include/cpu.h b/sys/ia64/include/cpu.h
index 3ae9bd1..cb2a671 100644
--- a/sys/ia64/include/cpu.h
+++ b/sys/ia64/include/cpu.h
@@ -57,11 +57,11 @@ struct clockframe {
};
#define CLKF_PC(cf) ((cf)->cf_tf.tf_special.iip)
#define CLKF_CPL(cf) ((cf)->cf_tf.tf_special.psr & IA64_PSR_CPL)
-#define CLKF_USERMODE(cf) (CLKF_CPL(cf) == IA64_PSR_CPL_USER)
+#define CLKF_USERMODE(cf) (CLKF_CPL(cf) != IA64_PSR_CPL_KERN)
#define TRAPF_PC(tf) ((tf)->tf_special.iip)
#define TRAPF_CPL(tf) ((tf)->tf_special.psr & IA64_PSR_CPL)
-#define TRAPF_USERMODE(tf) (TRAPF_CPL(tf) == IA64_PSR_CPL_USER)
+#define TRAPF_USERMODE(tf) (TRAPF_CPL(tf) != IA64_PSR_CPL_KERN)
/*
* CTL_MACHDEP definitions.
OpenPOWER on IntegriCloud