Merge branch 'core/percpu' into perfcounters/core
[linux-3.10.git] / arch / x86 / include / asm / irq_vectors.h
index b8d277f..0e2220b 100644 (file)
  *  some of the following vectors are 'rare', they are merged
  *  into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
  *  TLB, reschedule and local APIC vectors are performance-critical.
- *
- *  Vectors 0xf0-0xfa are free (reserved for future Linux use).
  */
 #ifdef CONFIG_X86_32
 
 # define SPURIOUS_APIC_VECTOR          0xff
 # define ERROR_APIC_VECTOR             0xfe
-# define INVALIDATE_TLB_VECTOR         0xfd
-# define RESCHEDULE_VECTOR             0xfc
-# define CALL_FUNCTION_VECTOR          0xfb
-# define CALL_FUNCTION_SINGLE_VECTOR   0xfa
-# define THERMAL_APIC_VECTOR           0xf0
+# define RESCHEDULE_VECTOR             0xfd
+# define CALL_FUNCTION_VECTOR          0xfc
+# define CALL_FUNCTION_SINGLE_VECTOR   0xfb
+# define THERMAL_APIC_VECTOR           0xfa
+/* 0xf8 - 0xf9 : free */
+# define INVALIDATE_TLB_VECTOR_END     0xf7
+# define INVALIDATE_TLB_VECTOR_START   0xf0    /* f0-f7 used for TLB flush */
+
+# define NUM_INVALIDATE_TLB_VECTORS    8
 
 #else
 
-#define SPURIOUS_APIC_VECTOR           0xff
-#define ERROR_APIC_VECTOR              0xfe
-#define RESCHEDULE_VECTOR              0xfd
-#define CALL_FUNCTION_VECTOR           0xfc
-#define CALL_FUNCTION_SINGLE_VECTOR    0xfb
-#define THERMAL_APIC_VECTOR            0xfa
-#define THRESHOLD_APIC_VECTOR          0xf9
-#define UV_BAU_MESSAGE                 0xf8
-#define INVALIDATE_TLB_VECTOR_END      0xf7
-#define INVALIDATE_TLB_VECTOR_START    0xf0    /* f0-f7 used for TLB flush */
+# define SPURIOUS_APIC_VECTOR          0xff
+# define ERROR_APIC_VECTOR             0xfe
+# define RESCHEDULE_VECTOR             0xfd
+# define CALL_FUNCTION_VECTOR          0xfc
+# define CALL_FUNCTION_SINGLE_VECTOR   0xfb
+# define THERMAL_APIC_VECTOR           0xfa
+# define THRESHOLD_APIC_VECTOR         0xf9
+# define UV_BAU_MESSAGE                        0xf8
+# define INVALIDATE_TLB_VECTOR_END     0xf7
+# define INVALIDATE_TLB_VECTOR_START   0xf0    /* f0-f7 used for TLB flush */
 
 #define NUM_INVALIDATE_TLB_VECTORS     8
 
 #define LAST_VM86_IRQ          15
 #define invalid_vm86_irq(irq)  ((irq) < 3 || (irq) > 15)
 
+#define NR_IRQS_LEGACY         16
+
 #if defined(CONFIG_X86_IO_APIC) && !defined(CONFIG_X86_VOYAGER)
+
+#include <asm/apicnum.h>       /* need MAX_IO_APICS */
+
+#ifndef CONFIG_SPARSE_IRQ
 # if NR_CPUS < MAX_IO_APICS
 #  define NR_IRQS (NR_VECTORS + (32 * NR_CPUS))
 # else
 #  define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS))
 # endif
+#else
+
+# define NR_IRQS                                       \
+       ((8 * NR_CPUS) > (32 * MAX_IO_APICS) ?          \
+               (NR_VECTORS + (8 * NR_CPUS)) :          \
+               (NR_VECTORS + (32 * MAX_IO_APICS)))     \
+
+#endif
 
 #elif defined(CONFIG_X86_VOYAGER)