MyOS Kernel
isr.h
Go to the documentation of this file.
1 
5 #ifndef ISR_H
6 #define ISR_H
7 
8 #include <stdint.h>
9 #include <sys/types.h>
10 
14 typedef struct {
15  uint32_t ds;
16  uint32_t edi;
17  uint32_t esi;
18  uint32_t ebp;
19  uint32_t esp;
20  uint32_t ebx;
21  uint32_t edx;
22  uint32_t ecx;
23  uint32_t eax;
24  uint32_t int_no;
25  uint32_t err_code;
26  uint32_t eip;
27  uint32_t cs;
28  uint32_t eflags;
29  uint32_t useresp;
30  uint32_t ss;
31 } registers_t;
32 
33 typedef void (*isr_t)(registers_t*);
34 
38 void isr_install();
39 
48 void isr_register_handler(int n,pid_t pid,void* handler);
49 
50 #endif
void(* isr_t)(registers_t *)
Type of an ISR handler function pointer.
Definition: isr.h:33
void isr_register_handler(int n, pid_t pid, void *handler)
Definition: isr.c:308
void isr_install()
Definition: isr.c:32
Definition: isr.h:14
uint32_t cs
Pushed by the processor automatically.
Definition: isr.h:27
uint32_t ds
Data segment selector.
Definition: isr.h:15
uint32_t edx
Pushed by pusha.
Definition: isr.h:21
uint32_t ebx
Pushed by pusha.
Definition: isr.h:20
uint32_t int_no
Interrupt number.
Definition: isr.h:24
uint32_t ss
Pushed by the processor automatically.
Definition: isr.h:30
uint32_t edi
Pushed by pusha.
Definition: isr.h:16
uint32_t err_code
Error code (if applicable)
Definition: isr.h:25
uint32_t esi
Pushed by pusha.
Definition: isr.h:17
uint32_t ecx
Pushed by pusha.
Definition: isr.h:22
uint32_t eip
Pushed by the processor automatically.
Definition: isr.h:26
uint32_t eax
Pushed by pusha.
Definition: isr.h:23
uint32_t esp
Pushed by pusha.
Definition: isr.h:19
uint32_t eflags
Pushed by the processor automatically.
Definition: isr.h:28
uint32_t useresp
Pushed by the processor automatically.
Definition: isr.h:29
uint32_t ebp
Pushed by pusha.
Definition: isr.h:18