aboutsummaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/trap.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c
index cbcf730..b73048d 100644
--- a/sys/arch/amd64/amd64/trap.c
+++ b/sys/arch/amd64/amd64/trap.c
@@ -50,6 +50,20 @@ static const char *trap_type[] = {
static const int TRAP_COUNT = __ARRAY_COUNT(trap_type);
static void
+dbg_errcode(struct trapframe *tf)
+{
+ uint64_t ec = tf->error_code;
+
+ if (tf->trapno == TRAP_PAGEFLT) {
+ kprintf("bits (pwui): %c%c%c%c\n",
+ __TEST(ec, __BIT(0)) ? 'p' : '-',
+ __TEST(ec, __BIT(1)) ? 'w' : '-',
+ __TEST(ec, __BIT(2)) ? 'u' : '-',
+ __TEST(ec, __BIT(4)) ? 'i' : '-');
+ }
+}
+
+static void
trap_print(struct trapframe *tf)
{
if (tf->trapno < TRAP_COUNT) {
@@ -57,6 +71,8 @@ trap_print(struct trapframe *tf)
} else {
kprintf("** Unknown trap %d **\n", tf->trapno);
}
+
+ dbg_errcode(tf);
}
static void