luxos/Kernel/hal/cpu/irq-asm.asm

160 lines
2.4 KiB
NASM
Raw Normal View History

2021-09-14 15:34:14 +00:00
bits 32
; !!! IRQ !!!
global Irq_0
global Irq_1
global Irq_2
global Irq_3
global Irq_4
global Irq_5
global Irq_6
global Irq_7
global Irq_8
global Irq_9
global Irq_10
global Irq_11
global Irq_12
global Irq_13
global Irq_14
global Irq_15
2021-09-14 15:34:14 +00:00
; 32: IRQ0
Irq_0:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 32; Note that these don't push an error code on the stack:
2021-09-14 15:34:14 +00:00
; We need to push a dummy error code
jmp irq_common_stub
; 33: IRQ1
Irq_1:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 33
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 34: IRQ2
Irq_2:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 34
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 35: IRQ3
Irq_3:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 35
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 36: IRQ4
Irq_4:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 36
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 37: IRQ5
Irq_5:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 37
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 38: IRQ6
Irq_6:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 38
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 39: IRQ7
Irq_7:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 39
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 40: IRQ8
Irq_8:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 40
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 41: IRQ9
Irq_9:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 41
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 42: IRQ10
Irq_10:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 42
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 43: IRQ11
Irq_11:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 43
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 44: IRQ12
Irq_12:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 44
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 45: IRQ13
Irq_13:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 45
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 46: IRQ14
Irq_14:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 46
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
; 47: IRQ15
Irq_15:
2021-09-14 15:34:14 +00:00
cli
push dword 0
push dword 47
2021-09-14 15:34:14 +00:00
jmp irq_common_stub
extern IrqHandler
2021-09-14 15:34:14 +00:00
; This is a stub that we have created for IRQ based ISRs. This calls
; 'Irq__handler' in our C code. We need to create this in an 'irq.c'
2021-09-14 15:34:14 +00:00
irq_common_stub:
pusha
push ds
push es
push fs
push gs
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov eax, esp
push eax
mov eax, IrqHandler
2021-09-14 15:34:14 +00:00
call eax
pop eax
pop gs
pop fs
pop es
pop ds
popa
add esp, 8
iret