toaruos/kernel/cpu/isrs.c

22 lines
492 B
C
Raw Normal View History

/* This file is part of ToaruOS and is released under the terms
* of the NCSA / University of Illinois License - see LICENSE.md
* Copyright (C) 2011-2014 Kevin Lange
*
* Interrupt Services Requests
*/
2011-01-16 06:41:17 +03:00
#include <system.h>
2011-12-27 05:23:58 +04:00
#include <logging.h>
2011-01-16 06:41:17 +03:00
2014-04-13 13:01:56 +04:00
extern irq_handler_t isrs_routines[256];
2013-06-06 10:10:36 +04:00
extern void fault_error(struct regs *r);
2011-01-21 04:49:35 +03:00
void fault_handler(struct regs *r) {
2013-06-06 10:10:36 +04:00
irq_handler_t handler;
2011-03-30 06:08:56 +04:00
handler = isrs_routines[r->int_no];
if (handler) {
handler(r);
} else {
2013-06-06 10:10:36 +04:00
fault_error(r);
2011-01-16 06:41:17 +03:00
}
}