mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-03 18:22:22 +00:00
28 lines
686 B
C
28 lines
686 B
C
#ifndef _ISR_H
|
|
#define _ISR_H
|
|
|
|
#include <kernel.h>
|
|
|
|
// Interrupt frame (ie. what's on the stack on interrupt)
|
|
struct isr_int_frame {
|
|
// Pushed by OS
|
|
uint32_t gs, fs, es, ds;
|
|
uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax;
|
|
uint32_t interrupt, error;
|
|
|
|
// Pushed by CPU
|
|
uint32_t eip, cs, eflags, user_esp, user_ss;
|
|
};
|
|
typedef void (*isr_handler_ptr)(struct isr_int_frame* iframe);
|
|
|
|
int isr_init(void);
|
|
void isr_register(uint8_t i, isr_handler_ptr handler);
|
|
void isr_handle_interrupt(struct isr_int_frame iframe);
|
|
|
|
// Assembly definitions (isr.s)
|
|
extern void isr_return(void);
|
|
extern void* isr_redirect_table[48]; // ISR Table
|
|
extern void isr128(void); // int 0x80 - syscall
|
|
|
|
#endif
|