Index: kernel/arch/amd64/include/arch/interrupt.h
===================================================================
--- kernel/arch/amd64/include/arch/interrupt.h	(revision 29beac8b83c5330c3a33c422647b7d7c32d16c32)
+++ kernel/arch/amd64/include/arch/interrupt.h	(revision ef56a4328da1ed71522c868067e6224662037a28)
@@ -86,5 +86,5 @@
 extern void (*disable_irqs_function)(uint16_t);
 extern void (*enable_irqs_function)(uint16_t);
-extern void (*eoi_function)(void);
+extern void (*eoi_function)(unsigned int);
 extern const char *irqs_info;
 
Index: kernel/arch/amd64/src/interrupt.c
===================================================================
--- kernel/arch/amd64/src/interrupt.c	(revision 29beac8b83c5330c3a33c422647b7d7c32d16c32)
+++ kernel/arch/amd64/src/interrupt.c	(revision ef56a4328da1ed71522c868067e6224662037a28)
@@ -60,5 +60,5 @@
 void (*disable_irqs_function)(uint16_t irqmask) = NULL;
 void (*enable_irqs_function)(uint16_t irqmask) = NULL;
-void (*eoi_function)(void) = NULL;
+void (*eoi_function)(unsigned int) = NULL;
 const char *irqs_info = NULL;
 
@@ -91,8 +91,8 @@
 }
 
-static void trap_virtual_eoi(void)
+static void trap_virtual_eoi(unsigned int irq)
 {
 	if (eoi_function)
-		eoi_function();
+		eoi_function(irq);
 	else
 		panic("No eoi_function.");
@@ -157,5 +157,5 @@
 static void tlb_shootdown_ipi(unsigned int n, istate_t *istate)
 {
-	trap_virtual_eoi();
+	trap_virtual_eoi(0);
 	tlb_shootdown_ipi_recv();
 }
@@ -184,5 +184,5 @@
 		if (irq->preack) {
 			/* Send EOI before processing the interrupt */
-			trap_virtual_eoi();
+			trap_virtual_eoi(inum);
 			ack = true;
 		}
@@ -200,5 +200,5 @@
 
 	if (!ack)
-		trap_virtual_eoi();
+		trap_virtual_eoi(inum);
 }
 
Index: kernel/arch/ia32/include/arch/interrupt.h
===================================================================
--- kernel/arch/ia32/include/arch/interrupt.h	(revision 29beac8b83c5330c3a33c422647b7d7c32d16c32)
+++ kernel/arch/ia32/include/arch/interrupt.h	(revision ef56a4328da1ed71522c868067e6224662037a28)
@@ -90,5 +90,5 @@
 extern void (*disable_irqs_function)(uint16_t);
 extern void (*enable_irqs_function)(uint16_t);
-extern void (*eoi_function)(void);
+extern void (*eoi_function)(unsigned int);
 extern const char *irqs_info;
 
Index: kernel/arch/ia32/include/arch/smp/apic.h
===================================================================
--- kernel/arch/ia32/include/arch/smp/apic.h	(revision 29beac8b83c5330c3a33c422647b7d7c32d16c32)
+++ kernel/arch/ia32/include/arch/smp/apic.h	(revision ef56a4328da1ed71522c868067e6224662037a28)
@@ -356,5 +356,5 @@
 
 extern void l_apic_init(void);
-extern void l_apic_eoi(void);
+extern void l_apic_eoi(unsigned int);
 extern int l_apic_send_custom_ipi(uint8_t, uint8_t);
 extern int l_apic_broadcast_custom_ipi(uint8_t);
Index: kernel/arch/ia32/src/interrupt.c
===================================================================
--- kernel/arch/ia32/src/interrupt.c	(revision 29beac8b83c5330c3a33c422647b7d7c32d16c32)
+++ kernel/arch/ia32/src/interrupt.c	(revision ef56a4328da1ed71522c868067e6224662037a28)
@@ -63,5 +63,5 @@
 void (*disable_irqs_function)(uint16_t irqmask) = NULL;
 void (*enable_irqs_function)(uint16_t irqmask) = NULL;
-void (*eoi_function)(void) = NULL;
+void (*eoi_function)(unsigned int) = NULL;
 const char *irqs_info = NULL;
 
@@ -90,8 +90,8 @@
 }
 
-static void trap_virtual_eoi(void)
+static void trap_virtual_eoi(unsigned int inum)
 {
 	if (eoi_function)
-		eoi_function();
+		eoi_function(inum);
 	else
 		panic("No eoi_function.");
@@ -179,5 +179,5 @@
     istate_t *istate __attribute__((unused)))
 {
-	trap_virtual_eoi();
+	trap_virtual_eoi(0);
 	tlb_shootdown_ipi_recv();
 }
@@ -204,5 +204,5 @@
 		if (irq->preack) {
 			/* Send EOI before processing the interrupt */
-			trap_virtual_eoi();
+			trap_virtual_eoi(inum);
 			ack = true;
 		}
@@ -219,5 +219,5 @@
 
 	if (!ack)
-		trap_virtual_eoi();
+		trap_virtual_eoi(inum);
 }
 
Index: kernel/arch/ia32/src/smp/apic.c
===================================================================
--- kernel/arch/ia32/src/smp/apic.c	(revision 29beac8b83c5330c3a33c422647b7d7c32d16c32)
+++ kernel/arch/ia32/src/smp/apic.c	(revision ef56a4328da1ed71522c868067e6224662037a28)
@@ -508,5 +508,5 @@
 
 /** Local APIC End of Interrupt. */
-void l_apic_eoi(void)
+void l_apic_eoi(unsigned int ignored)
 {
 	l_apic[EOI] = 0;
Index: kernel/arch/mips32/src/mach/malta/malta.c
===================================================================
--- kernel/arch/mips32/src/mach/malta/malta.c	(revision 29beac8b83c5330c3a33c422647b7d7c32d16c32)
+++ kernel/arch/mips32/src/mach/malta/malta.c	(revision ef56a4328da1ed71522c868067e6224662037a28)
@@ -95,5 +95,5 @@
 #endif
 	}
-	pic_eoi();
+	pic_eoi(isa_irq);
 }
 
Index: kernel/genarch/include/genarch/drivers/i8259/i8259.h
===================================================================
--- kernel/genarch/include/genarch/drivers/i8259/i8259.h	(revision 29beac8b83c5330c3a33c422647b7d7c32d16c32)
+++ kernel/genarch/include/genarch/drivers/i8259/i8259.h	(revision ef56a4328da1ed71522c868067e6224662037a28)
@@ -55,5 +55,5 @@
 extern void pic_enable_irqs(uint16_t);
 extern void pic_disable_irqs(uint16_t);
-extern void pic_eoi(void);
+extern void pic_eoi(unsigned int);
 
 #endif
Index: kernel/genarch/src/drivers/i8259/i8259.c
===================================================================
--- kernel/genarch/src/drivers/i8259/i8259.c	(revision 29beac8b83c5330c3a33c422647b7d7c32d16c32)
+++ kernel/genarch/src/drivers/i8259/i8259.c	(revision ef56a4328da1ed71522c868067e6224662037a28)
@@ -112,8 +112,9 @@
 }
 
-void pic_eoi(void)
+void pic_eoi(unsigned int irq)
 {
+	if (irq >= 8)
+		pio_write_8(&saved_pic1->port1, PIC_OCW4 | PIC_OCW4_NSEOI);
 	pio_write_8(&saved_pic0->port1, PIC_OCW4 | PIC_OCW4_NSEOI);
-	pio_write_8(&saved_pic1->port1, PIC_OCW4 | PIC_OCW4_NSEOI);
 }
 
