diff options
author | Ian Moffett <ian@osmora.org> | 2024-02-29 22:09:17 -0500 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-02-29 22:09:17 -0500 |
commit | 69acd1f2cfdbf7ded636a8ec098a1dcc86fecdb0 (patch) | |
tree | 39a6faa27aac1fba47a9debbbb9f06bb431689cc | |
parent | 2a9d7b9cc5f82eb60b295e4a689ac20f27dd65cb (diff) |
kernel/amd64: trap: Simplify trap_print() logic
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | sys/arch/amd64/amd64/trap.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c index 703b6cf..cbcf730 100644 --- a/sys/arch/amd64/amd64/trap.c +++ b/sys/arch/amd64/amd64/trap.c @@ -52,15 +52,11 @@ static const int TRAP_COUNT = __ARRAY_COUNT(trap_type); static void trap_print(struct trapframe *tf) { - const char *mode; - if (tf->trapno < TRAP_COUNT) { - kprintf("** Fatal %s", trap_type[tf->trapno]); + kprintf("** Fatal %s **\n", trap_type[tf->trapno]); } else { - kprintf("** Unknown trap %d", tf->trapno); + kprintf("** Unknown trap %d **\n", tf->trapno); } - mode = __TEST(tf->trapno, TRAP_USER) ? "user" : "supervisor"; - kprintf(" in %s mode **\n", mode); } static void |