ReactOS  0.4.14-dev-358-gbef841c
halirq.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #ifdef CONFIG_SMP
5 
6 #define FIRST_DEVICE_VECTOR (0x30)
7 #define FIRST_SYSTEM_VECTOR (0xef)
8 
9 #define IRQ_BASE FIRST_DEVICE_VECTOR
10 #define NR_IRQS (FIRST_SYSTEM_VECTOR - FIRST_DEVICE_VECTOR)
11 
12 /*
13  * FIXME:
14  * This does not work if we have more than 24 IRQs (ie. more than one I/O APIC)
15  */
16 #define VECTOR2IRQ(vector) (23 - (vector - IRQ_BASE) / 8)
17 #define VECTOR2IRQL(vector) (PROFILE_LEVEL - VECTOR2IRQ(vector))
18 #define IRQ2VECTOR(irq) (((23 - (irq)) * 8) + FIRST_DEVICE_VECTOR)
19 
20 #else
21 
22 #define IRQ_BASE (0x30)
23 #define NR_IRQS (16)
24 
25 #define VECTOR2IRQ(vector) ((vector) - IRQ_BASE)
26 #define VECTOR2IRQL(vector) (PROFILE_LEVEL - VECTOR2IRQ(vector))
27 #define IRQ2VECTOR(irq) ((irq) + IRQ_BASE)
28 
29 #endif