blob: dc16f89647d4958c30b60707b7db7f087ba83f21 [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
swissChili825d46b2021-02-21 10:14:16 -08007 push 0 ; Error code
8 push %2 ; Interrupt number
swissChili9b3584b2021-02-18 13:57:27 -08009 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:
swissChili1e8b7562021-12-22 21:22:57 -080031 pushad
swissChili9b3584b2021-02-18 13:57:27 -080032 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
swissChili1e8b7562021-12-22 21:22:57 -080049 popad
swissChili9b3584b2021-02-18 13:57:27 -080050 add esp, 8
51 sti
52 iret
53