blob: 9806b1ee7fe37083585bc9fbf2887976d1ef01e8 [file] [log] [blame]
swissChili9b3584b2021-02-18 13:57:27 -08001 [bits 32]
2
3%macro IRQ 2
4 [global irq%1]
5irq%1:
6 cli
7 push byte 0 ; Error code
8 push byte %2 ; Interrupt number
9 jmp irq_common
10%endmacro
11
12IRQ 0, 32
13IRQ 1, 33
14IRQ 2, 34
15IRQ 3, 35
16IRQ 4, 36
17IRQ 5, 37
18IRQ 6, 38
19IRQ 7, 39
20IRQ 8, 40
21IRQ 9, 41
22IRQ 10, 42
23IRQ 11, 43
24IRQ 12, 44
25IRQ 13, 45
26IRQ 14, 46
27IRQ 15, 47
28
29 [extern irq_handler]
30irq_common:
31 pusha
32 mov ax, ds ; Save data segment
33 push eax
34
35 mov ax, 0x10 ; New segments
36 mov ds, ax
37 mov es, ax
38 mov fs, ax
39 mov gs, ax
40
41 call irq_handler
42
43 pop ebx ; Old data segment
44 mov ds, bx
45 mov es, bx
46 mov fs, bx
47 mov gs, bx
48
49 popa
50 add esp, 8
51 sti
52 iret
53