2019-02-10 14:11:07 -06:00
|
|
|
#ifndef ISR_H
|
|
|
|
#define ISR_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2019-03-11 09:32:55 -05:00
|
|
|
/* Struct which aggregates many registers */
|
|
|
|
typedef struct {
|
|
|
|
uint32_t ds; /* Data segment selector */
|
|
|
|
uint32_t edi,esi,ebp,esp,ebx,edx,ecx,eax; /* Pushed by pusha. */
|
|
|
|
uint32_t int_no,err_code; /* Interrupt number and error code (if applicable) */
|
|
|
|
uint32_t eip,cs,eflags,useresp,ss; /* Pushed by the processor automatically */
|
|
|
|
} registers_t;
|
|
|
|
|
2019-12-14 10:41:04 -06:00
|
|
|
typedef void (*isr_t)(registers_t*);
|
2019-02-10 14:11:07 -06:00
|
|
|
|
|
|
|
void isr_install();
|
2019-03-11 09:32:55 -05:00
|
|
|
void isr_register_handler(uint8_t n,isr_t handler);
|
2019-02-10 14:11:07 -06:00
|
|
|
|
|
|
|
#endif
|