From d6b373756ddc6de416636f1e2648416f174e9a71 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 15 Nov 2025 20:48:12 -0500 Subject: kern/amd64: Add panic function + MU helpers This commit introduces a panic function as well as a panic machine unifier layer for MD specifics that help bring the system to a halt. Signed-off-by: Ian Moffett --- sys/arch/amd64/cpu/trap.S | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'sys/arch/amd64/cpu') diff --git a/sys/arch/amd64/cpu/trap.S b/sys/arch/amd64/cpu/trap.S index 1761358..d3b9887 100644 --- a/sys/arch/amd64/cpu/trap.S +++ b/sys/arch/amd64/cpu/trap.S @@ -64,22 +64,17 @@ trapstr_tab: .text .globl trap_dispatch - .extern uart_write + .extern panic trap_dispatch: mov 0(%rdi), %rax /* Vector */ - push %rax /* Save it */ cmp $TRAPSTR_ENTRIES, %rax /* Too big? */ jg .unknown_trap /* Yeah... */ - lea error_header(%rip), %rdi /* Load the error header */ - call uart_puts /* Print it */ - - pop %rcx /* Get the vector number */ + mov %rax, %rcx /* Vector -> RCX */ lea trapstr_convtab(%rip), %rdi /* Load the base here */ leaq (%rdi, %rcx, 8), %rdi /* Scale by the vector */ mov (%rdi), %rdi /* Get the error string address */ - - call uart_puts + call panic retq .unknown_trap: lea error_unknown(%rip), %rdi -- cgit v1.2.3