53 lines
1.1 KiB
C
53 lines
1.1 KiB
C
/*
|
||
* idt.h – Interrupt Descriptor Table interface.
|
||
*
|
||
* Declares the ISR stack frame layout (pushed by isr_common in isr.S)
|
||
* and the IDT initialisation function.
|
||
*/
|
||
|
||
#ifndef IDT_H
|
||
#define IDT_H
|
||
|
||
#include "kernel_types.h"
|
||
#include "boot_info.h"
|
||
|
||
/*
|
||
* ISRFrame – register state saved by isr_common before calling
|
||
* isr_handler(). The order must match the push sequence in isr.S.
|
||
*/
|
||
typedef struct {
|
||
/* General-purpose registers (pushed by isr_common) */
|
||
UINT64 r15;
|
||
UINT64 r14;
|
||
UINT64 r13;
|
||
UINT64 r12;
|
||
UINT64 r11;
|
||
UINT64 r10;
|
||
UINT64 r9;
|
||
UINT64 r8;
|
||
UINT64 rbp;
|
||
UINT64 rdi;
|
||
UINT64 rsi;
|
||
UINT64 rdx;
|
||
UINT64 rcx;
|
||
UINT64 rbx;
|
||
UINT64 rax;
|
||
|
||
/* Pushed by the ISR stub macros */
|
||
UINT64 vector;
|
||
UINT64 error_code;
|
||
|
||
/* Pushed by the CPU on interrupt entry */
|
||
UINT64 rip;
|
||
UINT64 cs;
|
||
UINT64 rflags;
|
||
} ISRFrame;
|
||
|
||
/*
|
||
* Install our IDT: copies firmware entries for vectors 32+,
|
||
* overrides vectors 0-31 with kernel exception handlers.
|
||
*/
|
||
void idt_init(BootInfo *Boot);
|
||
|
||
#endif /* IDT_H */
|