Commit 01ad46c1 authored by Christian Dietrich's avatar Christian Dietrich Committed by Gerrit Code Review

i386: FaultDetectedHook on unhandled interrupt

Until now, unhandled interrupt resulted in a hanging machine. This did *not*
cause the SDC rates to change, but made the TIMEOUT numbers for fault injection
campaigns slightly too high.

Change-Id: I4616c5ddad66659bab604cd3ed5b5405ceea44ce
parent 8843e857
......@@ -10,6 +10,7 @@
#include "machine.h"
#include "lapic.h"
#include "output.h"
#include "hooks.h"
#define CONTINUE_UNHANDLED_IRQ 0
......@@ -21,6 +22,11 @@ ISR(unhandled) {
uint32_t intno;
asm volatile("" : "=a"(intno));
// send end-of-interrupt (unless exception)
if(intno > 31) LAPIC::send_eoi();
CALL_HOOK(FaultDetectedHook, TRAPdetected, intno, cpu->eip);
// print and halt when debugging
uint32_t ip = cpu->eip;
kout << "unhandled interrupt ";
......@@ -29,21 +35,14 @@ ISR(unhandled) {
kout << hex << ip;
kout << endl;
asm("hlt");
#if CONTINUE_UNHANDLED_IRQ
// send end-of-interrupt (unless exception)
if(intno > 31) LAPIC::send_eoi();
#else // CONTINUE_UNHANDLED_IRQ
// panic on unhandled interrupts
Machine::panic();
#endif // CONTINUE_UNHANDLED_IRQ
Machine::halt();
}
// NMI error handler
IRQ_HANDLER(2) {
CALL_HOOK(FaultDetectedHook, TRAPdetected, 0, 0);
// TODO: anything useful left to do?
debug << "PANIC" << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment