mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-21 23:31:11 +00:00
x86: Set interrupt handler for Double Fault exception
This patch sets an interrupt handler for Double Fault exception during CPU initialization. In case such exception is raised, we halt the system. This way, we avoid the system to triple fault (due to an unhandled interrupt for instance), leaving no trace about what cause the triple fault.
This commit is contained in:
parent
e28f400e0c
commit
604538ed62
@ -30,10 +30,23 @@
|
||||
|
||||
#include "gdt.h"
|
||||
#include "idt.h"
|
||||
#include "interrupt.h"
|
||||
#include "helpers.h"
|
||||
|
||||
static void
|
||||
double_fault_handler(struct interrupt_context context)
|
||||
{
|
||||
halt();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
cpu_init(void)
|
||||
{
|
||||
gdt_init();
|
||||
idt_init();
|
||||
|
||||
/* Set an interrupt handler for Double Fault exception. This way, we avoid
|
||||
* the system to triple fault, leaving no trace about what happened.
|
||||
*/
|
||||
SET_INTERRUPT_HANDLER(8, 1, double_fault_handler);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user