From a30f8ce5d9d2a63b6b538707c4fc7549bc380492 Mon Sep 17 00:00:00 2001 From: Matheus Date: Mon, 16 Sep 2024 17:11:39 -0300 Subject: [PATCH] interrupt: change panic message and fix id issue --- kernel-src/sys/interrupt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel-src/sys/interrupt.c b/kernel-src/sys/interrupt.c index 80f9b86b..23f158ca 100644 --- a/kernel-src/sys/interrupt.c +++ b/kernel-src/sys/interrupt.c @@ -99,8 +99,11 @@ void interrupt_isr(int vec, context_t *ctx) { isr_t *isr = ¤t_cpu()->isr[vec]; current_cpu()->intstatus = false; - if (isr->func == NULL) - _panic("Unregistered interrupt", ctx); + if (isr->func == NULL) { + char oops[64]; + snprintf(oops, 64, "Unregistered interrupt %d\n", vec); + _panic(oops, ctx); + } if (current_cpu()->ipl > isr->priority) { runisr(isr, ctx); @@ -138,7 +141,7 @@ void interrupt_register(int vector, void (*func)(isr_t *self, context_t *ctx), v isr_t *isr = ¤t_cpu()->isr[vector]; isr->func = func; isr->eoi = eoi; - isr->id = (uint64_t)current_cpu_id() | vector; + isr->id = ((uint64_t)current_cpu_id() << 32) | vector; isr->priority = priority; isr->pending = false;