A bad call to adi_register_driver() generates a crash report instead of halting the kernel
@@ -49,8 +49,11 @@ static void _adi_interrupt_handler(registers_t* regs) {
}
void adi_register_driver(const char* name, uint32_t irq) {
- assert(irq > 0 && irq < MAX_INT_VECTOR, "Invalid IRQ provided");
- assert(!_adi_drivers[irq].task, "IRQ already mapped to a driver task");
+ task_assert(irq > 0 && irq < MAX_INT_VECTOR, "Invalid IRQ provided");
+ if (_adi_drivers[irq].task) {
+ printf("invalid adi_register_driver() will kill %s. IRQ already mapped to a driver task\n", name);
+ task_assert(false, "IRQ already mapped to a driver task");
+ }
task_small_t* current_task = tasking_get_current_task();
