From 5126951a79d722793e654cddcc8996f73f0c5d05 Mon Sep 17 00:00:00 2001 From: Edgaru089 Date: Sun, 14 Nov 2021 19:42:44 +0800 Subject: [PATCH] driver/pic: one argument for IRQ handlers --- driver/irq/pic/int_handler.asm.S | 2 ++ driver/irq/pic/pic.h | 1 + driver/irq/pic/pic_init.c | 1 + 3 files changed, 4 insertions(+) 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;