diff --git a/reactos/hal/halx86/directory.rbuild b/reactos/hal/halx86/directory.rbuild
index 9c8c482a2c7..a40bca6119b 100644
--- a/reactos/hal/halx86/directory.rbuild
+++ b/reactos/hal/halx86/directory.rbuild
@@ -13,9 +13,9 @@
-
+
diff --git a/reactos/hal/halx86/include/hal.h b/reactos/hal/halx86/include/hal.h
index 124d716b95f..ddf7518f2a8 100644
--- a/reactos/hal/halx86/include/hal.h
+++ b/reactos/hal/halx86/include/hal.h
@@ -55,13 +55,11 @@
#define TAG_BUS_HANDLER 'BusH'
/* Internal HAL Headers */
-#include "apic.h"
#include "bus.h"
#include "halirq.h"
#include "haldma.h"
#include "halp.h"
#include "mps.h"
-#include "ioapic.h"
#include "halacpi.h"
/* EOF */
diff --git a/reactos/hal/halx86/include/halirq.h b/reactos/hal/halx86/include/halirq.h
index 63dec6e62e8..8bde9191f02 100644
--- a/reactos/hal/halx86/include/halirq.h
+++ b/reactos/hal/halx86/include/halirq.h
@@ -4,29 +4,19 @@
#pragma once
-#ifdef CONFIG_SMP
+UCHAR
+FASTCALL
+HalpIrqToVector(UCHAR Irq);
-#define FIRST_DEVICE_VECTOR (0x30)
-#define FIRST_SYSTEM_VECTOR (0xef)
+KIRQL
+FASTCALL
+HalpVectorToIrql(UCHAR Vector);
-#define IRQ_BASE FIRST_DEVICE_VECTOR
-#define NR_IRQS (FIRST_SYSTEM_VECTOR - FIRST_DEVICE_VECTOR)
+UCHAR
+FASTCALL
+HalpVectorToIrq(UCHAR Vector);
-/*
- * FIXME:
- * This does not work if we have more than 24 IRQs (ie. more than one I/O APIC)
- */
-#define VECTOR2IRQ(vector) (23 - (vector - IRQ_BASE) / 8)
-#define VECTOR2IRQL(vector) (PROFILE_LEVEL - VECTOR2IRQ(vector))
-#define IRQ2VECTOR(irq) (((23 - (irq)) * 8) + FIRST_DEVICE_VECTOR)
+#define VECTOR2IRQ(vector) HalpVectorToIrq(vector)
+#define VECTOR2IRQL(vector) HalpVectorToIrql(vector)
+#define IRQ2VECTOR(irq) HalpIrqToVector(irq)
-#else
-
-#define IRQ_BASE (0x30)
-#define NR_IRQS (16)
-
-#define VECTOR2IRQ(vector) ((vector) - IRQ_BASE)
-#define VECTOR2IRQL(vector) (PROFILE_LEVEL - VECTOR2IRQ(vector))
-#define IRQ2VECTOR(irq) ((irq) + IRQ_BASE)
-
-#endif
diff --git a/reactos/hal/halx86/up/pic.c b/reactos/hal/halx86/up/pic.c
index d441c1a4997..6a8929bf4a5 100644
--- a/reactos/hal/halx86/up/pic.c
+++ b/reactos/hal/halx86/up/pic.c
@@ -512,6 +512,27 @@ HalpInitializePICs(IN BOOLEAN EnableInterrupts)
__writeeflags(EFlags);
}
+UCHAR
+FASTCALL
+HalpIrqToVector(UCHAR Irq)
+{
+ return (PRIMARY_VECTOR_BASE + Irq);
+}
+
+UCHAR
+FASTCALL
+HalpVectorToIrq(UCHAR Vector)
+{
+ return (Vector - PRIMARY_VECTOR_BASE);
+}
+
+KIRQL
+FASTCALL
+HalpVectorToIrql(UCHAR Vector)
+{
+ return (PROFILE_LEVEL - (Vector - PRIMARY_VECTOR_BASE));
+}
+
/* IRQL MANAGEMENT ************************************************************/
/*