29 lines
815 B
C
29 lines
815 B
C
#pragma once
|
|
#include "stdarg.h"
|
|
|
|
|
|
// c.f. intel software-developer-vol-1 6.4.1
|
|
struct interrupt_frame {
|
|
uint32_t eip;
|
|
uint32_t cs;
|
|
uint32_t eflags;
|
|
uint32_t esp;
|
|
uint32_t ss;
|
|
};
|
|
|
|
// Exception
|
|
// Exception
|
|
#define DECLARE_INTERRUPT(int_nb) \
|
|
void print_handler_##int_nb(struct interrupt_frame *frame, ulong error_code);
|
|
|
|
#define ACCESS_INTERRUPT(int_nb) print_handler_##int_nb
|
|
|
|
void pagefault_handler(struct interrupt_frame *frame, ulong error_code);
|
|
DECLARE_INTERRUPT(EXCEPTION_DOUBLE_FAULT)
|
|
|
|
// IRQ
|
|
void pit_handler(struct interrupt_frame *frame);
|
|
void keyboard_handler(struct interrupt_frame *frame);
|
|
void timer_handler(struct interrupt_frame *frame);
|
|
void serial_handler(struct interrupt_frame *frame);
|