driver/pic: one argument for IRQ handlers

This commit is contained in:
Edgaru089 2021-11-14 19:42:44 +08:00
parent 219bf76535
commit 5126951a79
3 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,7 @@ format elf64
include 'pic_constants.incS' include 'pic_constants.incS'
extrn irq_pic_IntHandler extrn irq_pic_IntHandler
extrn irq_pic_IRQHandler_Data
extrn irq_pic_IRQHandlerRaw extrn irq_pic_IRQHandlerRaw
public irq_pic_IntHandler20h public irq_pic_IntHandler20h
@ -52,6 +53,7 @@ macro inth op1 {
push r9 push r9
push r10 push r10
push r11 push r11
mov rdi, [irq_pic_IRQHandler_Data+op1*8]
call irq_pic_IntHandler call irq_pic_IntHandler
pop r11 pop r11
pop r10 pop r10

View File

@ -34,6 +34,7 @@ typedef SYSV_ABI void (*irq_pic_IRQHandlerType)();
// defined in pic_init.c // defined in pic_init.c
extern irq_pic_IRQHandlerType irq_pic_IRQHandler[16]; extern irq_pic_IRQHandlerType irq_pic_IRQHandler[16];
extern uintptr_t irq_pic_IRQHandler_Data[16]; // written into RDI on handler (first argument)
extern bool irq_pic_Enabled; extern bool irq_pic_Enabled;
// If IRQHandlerRaw[irq] is not NULL, the function is jumped to (not called). // If IRQHandlerRaw[irq] is not NULL, the function is jumped to (not called).

View File

@ -10,6 +10,7 @@
irq_pic_IRQHandlerType irq_pic_IRQHandler[16]; irq_pic_IRQHandlerType irq_pic_IRQHandler[16];
uintptr_t irq_pic_IRQHandler_Data[16];
void * irq_pic_IRQHandlerRaw[16]; void * irq_pic_IRQHandlerRaw[16];
bool irq_pic_Enabled; bool irq_pic_Enabled;