| .. | .. |
|---|
| 28 | 28 | #include <asm/irq.h> |
|---|
| 29 | 29 | #include <asm/sections.h> |
|---|
| 30 | 30 | |
|---|
| 31 | | -/* Interrupt handlers registered during init_IRQ */ |
|---|
| 32 | | -extern asmlinkage void apic_timer_interrupt(void); |
|---|
| 33 | | -extern asmlinkage void x86_platform_ipi(void); |
|---|
| 34 | | -extern asmlinkage void kvm_posted_intr_ipi(void); |
|---|
| 35 | | -extern asmlinkage void kvm_posted_intr_wakeup_ipi(void); |
|---|
| 36 | | -extern asmlinkage void kvm_posted_intr_nested_ipi(void); |
|---|
| 37 | | -extern asmlinkage void error_interrupt(void); |
|---|
| 38 | | -extern asmlinkage void irq_work_interrupt(void); |
|---|
| 39 | | -extern asmlinkage void uv_bau_message_intr1(void); |
|---|
| 40 | | - |
|---|
| 41 | | -extern asmlinkage void spurious_interrupt(void); |
|---|
| 42 | | -extern asmlinkage void thermal_interrupt(void); |
|---|
| 43 | | -extern asmlinkage void reschedule_interrupt(void); |
|---|
| 44 | | - |
|---|
| 45 | | -extern asmlinkage void irq_move_cleanup_interrupt(void); |
|---|
| 46 | | -extern asmlinkage void reboot_interrupt(void); |
|---|
| 47 | | -extern asmlinkage void threshold_interrupt(void); |
|---|
| 48 | | -extern asmlinkage void deferred_error_interrupt(void); |
|---|
| 49 | | - |
|---|
| 50 | | -extern asmlinkage void call_function_interrupt(void); |
|---|
| 51 | | -extern asmlinkage void call_function_single_interrupt(void); |
|---|
| 52 | | - |
|---|
| 53 | 31 | #ifdef CONFIG_X86_LOCAL_APIC |
|---|
| 54 | 32 | struct irq_data; |
|---|
| 55 | 33 | struct pci_dev; |
|---|
| .. | .. |
|---|
| 58 | 36 | enum irq_alloc_type { |
|---|
| 59 | 37 | X86_IRQ_ALLOC_TYPE_IOAPIC = 1, |
|---|
| 60 | 38 | X86_IRQ_ALLOC_TYPE_HPET, |
|---|
| 61 | | - X86_IRQ_ALLOC_TYPE_MSI, |
|---|
| 62 | | - X86_IRQ_ALLOC_TYPE_MSIX, |
|---|
| 39 | + X86_IRQ_ALLOC_TYPE_PCI_MSI, |
|---|
| 40 | + X86_IRQ_ALLOC_TYPE_PCI_MSIX, |
|---|
| 63 | 41 | X86_IRQ_ALLOC_TYPE_DMAR, |
|---|
| 64 | 42 | X86_IRQ_ALLOC_TYPE_UV, |
|---|
| 43 | + X86_IRQ_ALLOC_TYPE_IOAPIC_GET_PARENT, |
|---|
| 44 | + X86_IRQ_ALLOC_TYPE_HPET_GET_PARENT, |
|---|
| 65 | 45 | }; |
|---|
| 66 | 46 | |
|---|
| 47 | +struct ioapic_alloc_info { |
|---|
| 48 | + int pin; |
|---|
| 49 | + int node; |
|---|
| 50 | + u32 trigger : 1; |
|---|
| 51 | + u32 polarity : 1; |
|---|
| 52 | + u32 valid : 1; |
|---|
| 53 | + struct IO_APIC_route_entry *entry; |
|---|
| 54 | +}; |
|---|
| 55 | + |
|---|
| 56 | +struct uv_alloc_info { |
|---|
| 57 | + int limit; |
|---|
| 58 | + int blade; |
|---|
| 59 | + unsigned long offset; |
|---|
| 60 | + char *name; |
|---|
| 61 | + |
|---|
| 62 | +}; |
|---|
| 63 | + |
|---|
| 64 | +/** |
|---|
| 65 | + * irq_alloc_info - X86 specific interrupt allocation info |
|---|
| 66 | + * @type: X86 specific allocation type |
|---|
| 67 | + * @flags: Flags for allocation tweaks |
|---|
| 68 | + * @devid: Device ID for allocations |
|---|
| 69 | + * @hwirq: Associated hw interrupt number in the domain |
|---|
| 70 | + * @mask: CPU mask for vector allocation |
|---|
| 71 | + * @desc: Pointer to msi descriptor |
|---|
| 72 | + * @data: Allocation specific data |
|---|
| 73 | + * |
|---|
| 74 | + * @ioapic: IOAPIC specific allocation data |
|---|
| 75 | + * @uv: UV specific allocation data |
|---|
| 76 | +*/ |
|---|
| 67 | 77 | struct irq_alloc_info { |
|---|
| 68 | 78 | enum irq_alloc_type type; |
|---|
| 69 | 79 | u32 flags; |
|---|
| 70 | | - const struct cpumask *mask; /* CPU mask for vector allocation */ |
|---|
| 80 | + u32 devid; |
|---|
| 81 | + irq_hw_number_t hwirq; |
|---|
| 82 | + const struct cpumask *mask; |
|---|
| 83 | + struct msi_desc *desc; |
|---|
| 84 | + void *data; |
|---|
| 85 | + |
|---|
| 71 | 86 | union { |
|---|
| 72 | | - int unused; |
|---|
| 73 | | -#ifdef CONFIG_HPET_TIMER |
|---|
| 74 | | - struct { |
|---|
| 75 | | - int hpet_id; |
|---|
| 76 | | - int hpet_index; |
|---|
| 77 | | - void *hpet_data; |
|---|
| 78 | | - }; |
|---|
| 79 | | -#endif |
|---|
| 80 | | -#ifdef CONFIG_PCI_MSI |
|---|
| 81 | | - struct { |
|---|
| 82 | | - struct pci_dev *msi_dev; |
|---|
| 83 | | - irq_hw_number_t msi_hwirq; |
|---|
| 84 | | - }; |
|---|
| 85 | | -#endif |
|---|
| 86 | | -#ifdef CONFIG_X86_IO_APIC |
|---|
| 87 | | - struct { |
|---|
| 88 | | - int ioapic_id; |
|---|
| 89 | | - int ioapic_pin; |
|---|
| 90 | | - int ioapic_node; |
|---|
| 91 | | - u32 ioapic_trigger : 1; |
|---|
| 92 | | - u32 ioapic_polarity : 1; |
|---|
| 93 | | - u32 ioapic_valid : 1; |
|---|
| 94 | | - struct IO_APIC_route_entry *ioapic_entry; |
|---|
| 95 | | - }; |
|---|
| 96 | | -#endif |
|---|
| 97 | | -#ifdef CONFIG_DMAR_TABLE |
|---|
| 98 | | - struct { |
|---|
| 99 | | - int dmar_id; |
|---|
| 100 | | - void *dmar_data; |
|---|
| 101 | | - }; |
|---|
| 102 | | -#endif |
|---|
| 103 | | -#ifdef CONFIG_X86_UV |
|---|
| 104 | | - struct { |
|---|
| 105 | | - int uv_limit; |
|---|
| 106 | | - int uv_blade; |
|---|
| 107 | | - unsigned long uv_offset; |
|---|
| 108 | | - char *uv_name; |
|---|
| 109 | | - }; |
|---|
| 110 | | -#endif |
|---|
| 111 | | -#if IS_ENABLED(CONFIG_VMD) |
|---|
| 112 | | - struct { |
|---|
| 113 | | - struct msi_desc *desc; |
|---|
| 114 | | - }; |
|---|
| 115 | | -#endif |
|---|
| 87 | + struct ioapic_alloc_info ioapic; |
|---|
| 88 | + struct uv_alloc_info uv; |
|---|
| 116 | 89 | }; |
|---|
| 117 | 90 | }; |
|---|
| 118 | 91 | |
|---|
| .. | .. |
|---|
| 153 | 126 | extern char spurious_entries_start[]; |
|---|
| 154 | 127 | |
|---|
| 155 | 128 | #define VECTOR_UNUSED NULL |
|---|
| 156 | | -#define VECTOR_SHUTDOWN ((void *)~0UL) |
|---|
| 157 | | -#define VECTOR_RETRIGGERED ((void *)~1UL) |
|---|
| 129 | +#define VECTOR_SHUTDOWN ((void *)-1L) |
|---|
| 130 | +#define VECTOR_RETRIGGERED ((void *)-2L) |
|---|
| 158 | 131 | |
|---|
| 159 | 132 | typedef struct irq_desc* vector_irq_t[NR_VECTORS]; |
|---|
| 160 | 133 | DECLARE_PER_CPU(vector_irq_t, vector_irq); |
|---|