2017-11-02 23:14:46 -04:00
|
|
|
#include "config.h"
|
2017-11-02 22:51:24 -04:00
|
|
|
#include "logger.h"
|
|
|
|
|
|
|
|
struct IsrRegisters {
|
|
|
|
unsigned int ds; // Data segment selector
|
|
|
|
unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax; // Pushed by pusha.
|
|
|
|
unsigned int int_no, err_code; // Interrupt number and error code (if applicable)
|
|
|
|
unsigned int eip, cs, eflags, useresp, ss; // Pushed by the processor automatically.
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char *const messages[] = {
|
2017-11-02 22:57:19 -04:00
|
|
|
"Unhandled hardware interrupt: 0",
|
|
|
|
"Unhandled hardware interrupt: 1",
|
|
|
|
"Unhandled hardware interrupt: 2",
|
|
|
|
"Unhandled hardware interrupt: 3",
|
|
|
|
"Unhandled hardware interrupt: 4",
|
|
|
|
"Unhandled hardware interrupt: 5",
|
|
|
|
"Unhandled hardware interrupt: 6",
|
|
|
|
"Unhandled hardware interrupt: 7",
|
|
|
|
"Unhandled hardware interrupt: 8",
|
|
|
|
"Unhandled hardware interrupt: 9",
|
|
|
|
"Unhandled hardware interrupt: 10",
|
|
|
|
"Unhandled hardware interrupt: 11",
|
|
|
|
"Unhandled hardware interrupt: 12",
|
|
|
|
"Unhandled hardware interrupt: 13",
|
|
|
|
"Unhandled hardware interrupt: 14",
|
|
|
|
"Unhandled hardware interrupt: 15",
|
2017-11-02 22:51:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
void hwint_handler(struct IsrRegisters regs)
|
|
|
|
{
|
2017-11-02 23:14:46 -04:00
|
|
|
if (
|
|
|
|
!(regs.int_no >= INT_HWINT_FIRST &&
|
|
|
|
regs.int_no <= INT_HWINT_LAST)
|
|
|
|
) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const unsigned char hwint_no = regs.int_no - INT_HWINT_FIRST;
|
|
|
|
|
|
|
|
logger_warn(messages[hwint_no]);
|
2017-11-02 22:51:24 -04:00
|
|
|
}
|