0001
0002 #ifndef _ASM_X86_HW_IRQ_H
0003 #define _ASM_X86_HW_IRQ_H
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <asm/irq_vectors.h>
0018
0019 #define IRQ_MATRIX_BITS NR_VECTORS
0020
0021 #ifndef __ASSEMBLY__
0022
0023 #include <linux/percpu.h>
0024 #include <linux/profile.h>
0025 #include <linux/smp.h>
0026
0027 #include <linux/atomic.h>
0028 #include <asm/irq.h>
0029 #include <asm/sections.h>
0030
0031 #ifdef CONFIG_X86_LOCAL_APIC
0032 struct irq_data;
0033 struct pci_dev;
0034 struct msi_desc;
0035
0036 enum irq_alloc_type {
0037 X86_IRQ_ALLOC_TYPE_IOAPIC = 1,
0038 X86_IRQ_ALLOC_TYPE_HPET,
0039 X86_IRQ_ALLOC_TYPE_PCI_MSI,
0040 X86_IRQ_ALLOC_TYPE_PCI_MSIX,
0041 X86_IRQ_ALLOC_TYPE_DMAR,
0042 X86_IRQ_ALLOC_TYPE_AMDVI,
0043 X86_IRQ_ALLOC_TYPE_UV,
0044 };
0045
0046 struct ioapic_alloc_info {
0047 int pin;
0048 int node;
0049 u32 is_level : 1;
0050 u32 active_low : 1;
0051 u32 valid : 1;
0052 };
0053
0054 struct uv_alloc_info {
0055 int limit;
0056 int blade;
0057 unsigned long offset;
0058 char *name;
0059
0060 };
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075 struct irq_alloc_info {
0076 enum irq_alloc_type type;
0077 u32 flags;
0078 u32 devid;
0079 irq_hw_number_t hwirq;
0080 const struct cpumask *mask;
0081 struct msi_desc *desc;
0082 void *data;
0083
0084 union {
0085 struct ioapic_alloc_info ioapic;
0086 struct uv_alloc_info uv;
0087 };
0088 };
0089
0090 struct irq_cfg {
0091 unsigned int dest_apicid;
0092 unsigned int vector;
0093 };
0094
0095 extern struct irq_cfg *irq_cfg(unsigned int irq);
0096 extern struct irq_cfg *irqd_cfg(struct irq_data *irq_data);
0097 extern void lock_vector_lock(void);
0098 extern void unlock_vector_lock(void);
0099 #ifdef CONFIG_SMP
0100 extern void send_cleanup_vector(struct irq_cfg *);
0101 extern void irq_complete_move(struct irq_cfg *cfg);
0102 #else
0103 static inline void send_cleanup_vector(struct irq_cfg *c) { }
0104 static inline void irq_complete_move(struct irq_cfg *c) { }
0105 #endif
0106
0107 extern void apic_ack_edge(struct irq_data *data);
0108 #else
0109 static inline void lock_vector_lock(void) {}
0110 static inline void unlock_vector_lock(void) {}
0111 #endif
0112
0113
0114 extern atomic_t irq_err_count;
0115 extern atomic_t irq_mis_count;
0116
0117 extern void elcr_set_level_irq(unsigned int irq);
0118
0119 extern char irq_entries_start[];
0120 #ifdef CONFIG_TRACING
0121 #define trace_irq_entries_start irq_entries_start
0122 #endif
0123
0124 extern char spurious_entries_start[];
0125
0126 #define VECTOR_UNUSED NULL
0127 #define VECTOR_SHUTDOWN ((void *)-1L)
0128 #define VECTOR_RETRIGGERED ((void *)-2L)
0129
0130 typedef struct irq_desc* vector_irq_t[NR_VECTORS];
0131 DECLARE_PER_CPU(vector_irq_t, vector_irq);
0132
0133 #endif
0134
0135 #endif