diff --git a/driver/irq/pic/int_handler.asm.S b/driver/irq/pic/int_handler.asm.S index d42215e..d626533 100644 --- a/driver/irq/pic/int_handler.asm.S +++ b/driver/irq/pic/int_handler.asm.S @@ -3,6 +3,7 @@ format elf64 include 'pic_constants.incS' extrn irq_pic_IntHandler +extrn irq_pic_IRQHandler_Data extrn irq_pic_IRQHandlerRaw public irq_pic_IntHandler20h @@ -52,6 +53,7 @@ macro inth op1 { push r9 push r10 push r11 + mov rdi, [irq_pic_IRQHandler_Data+op1*8] call irq_pic_IntHandler pop r11 pop r10 diff --git a/driver/irq/pic/pic.h b/driver/irq/pic/pic.h index ddddbd4..6165745 100644 --- a/driver/irq/pic/pic.h +++ b/driver/irq/pic/pic.h @@ -34,6 +34,7 @@ typedef SYSV_ABI void (*irq_pic_IRQHandlerType)(); // defined in pic_init.c 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; // If IRQHandlerRaw[irq] is not NULL, the function is jumped to (not called). diff --git a/driver/irq/pic/pic_init.c b/driver/irq/pic/pic_init.c index cbcdbc9..9030adf 100644 --- a/driver/irq/pic/pic_init.c +++ b/driver/irq/pic/pic_init.c @@ -10,6 +10,7 @@ irq_pic_IRQHandlerType irq_pic_IRQHandler[16]; +uintptr_t irq_pic_IRQHandler_Data[16]; void * irq_pic_IRQHandlerRaw[16]; bool irq_pic_Enabled;