From 7ad9c01dad7b1b46eced8290b8b991383d648188 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 1 Jul 2024 23:34:57 +0300 Subject: expand notifications into interrupt handlers + Terminology is still a bit poor, and will still have to write documentation + implement ipis properly --- src/irq.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/irq.c') diff --git a/src/irq.c b/src/irq.c index db90d34..8d01fbd 100644 --- a/src/irq.c +++ b/src/irq.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -59,9 +60,19 @@ void handle_irq() id_t tid = irq_map[id]; if (!tid) { - bug("unregistered irq: %llu\n", (unsigned long long)id); + bug("unregistered irq %llu\n", (unsigned long long)id); return; } - /** @todo switch to thread */ + struct tcb *t = get_tcb(tid); + if (!t) { + error("tcb %llu dead at irq %llu\n", + (unsigned long long)tid, + (unsigned long long)id); + return; + } + + disable_irqs(); + notify(t); + error("misc error when trying to notify irq"); } -- cgit v1.3