refactor: organize all arch related files together.
[lunaix-os.git] / lunaix-os / includes / lunaix / isrm.h
1 /**
2  * @file irqm.h
3  * @author Lunaixsky
4  * @brief ISR Manager, managing the interrupt service routine allocations
5  * @version 0.1
6  * @date 2022-10-18
7  *
8  * @copyright Copyright (c) 2022
9  *
10  */
11 #ifndef __LUNAIX_ISRM_H
12 #define __LUNAIX_ISRM_H
13
14 #include <arch/i386/interrupts.h>
15 #include <lunaix/types.h>
16
17 #define IV_BASE 32
18 #define IV_OS IV_BASE
19 #define IV_EX 48
20 #define IV_MAX 256
21
22 typedef void (*isr_cb)(const isr_param*);
23
24 void
25 isrm_init();
26
27 void
28 isrm_ivfree(int iv);
29
30 int
31 isrm_ivosalloc(isr_cb handler);
32
33 int
34 isrm_ivexalloc(isr_cb handler);
35
36 int
37 isrm_bindirq(int irq, isr_cb irq_handler);
38
39 void
40 isrm_bindiv(int iv, isr_cb handler);
41
42 isr_cb
43 isrm_get(int iv);
44
45 #endif /* __LUNAIX_ISRM_H */