aboutsummaryrefslogtreecommitdiff
path: root/src/interrupts/interrupts.h
blob: b91e91c88b9e576461d7a1fc322f174abe81efa9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef MELVIX_INTERRUPTS_H
#define MELVIX_INTERRUPTS_H

// IDT
void idt_install();

void idt_set_gate(unsigned char num, unsigned long base, unsigned short sel, unsigned char flags);

// ISRS
void isrs_install();

struct regs {
    unsigned int gs, fs, es, ds;
    unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax;
    unsigned int int_no, err_code;
    unsigned int eip, cs, eflags, useresp, ss;
};

// IRQ
void irq_install();

void irq_install_handler(int irq, void (*handler)(struct regs *r));

void irq_uninstall_handler(int irq);

void irq_handler(struct regs *r);

#endif