aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2014-10-27 04:12:04 -0400
committerThomas Gleixner <tglx@linutronix.de>2014-12-16 08:08:17 -0500
commit8643e28da27d6d50f772409b8dc80bdab52239fb (patch)
tree032b4b2c9136b8f33e14c7e6c50fcba7982c4635 /arch
parentc3468952f073a9d4efa1e60c04c6e640ed9cf9d0 (diff)
x86, irq: Move IOAPIC related declarations from hw_irq.h into io_apic.h
Clean up code by moving IOAPIC related declarations from hw_irq.h into io_apic.h. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: H. Peter Anvin <hpa@linux.intel.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Grant Likely <grant.likely@linaro.org> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Matt Fleming <matt.fleming@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> Cc: Aubrey <aubrey.li@linux.intel.com> Cc: Ryan Desfosses <ryan@desfo.org> Cc: Quentin Lambert <lambert.quentin@gmail.com> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: http://lkml.kernel.org/r/1414397531-28254-14-git-send-email-jiang.liu@linux.intel.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/hw_irq.h33
-rw-r--r--arch/x86/include/asm/io_apic.h20
-rw-r--r--arch/x86/kernel/apic/io_apic.c10
-rw-r--r--arch/x86/kernel/crash.c1
-rw-r--r--arch/x86/kernel/machine_kexec_32.c1
-rw-r--r--arch/x86/kernel/machine_kexec_64.c1
-rw-r--r--arch/x86/kernel/reboot.c1
7 files changed, 33 insertions, 34 deletions
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index a7235777a478..9662290e0b20 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -159,39 +159,6 @@ static inline void lock_vector_lock(void) {}
159static inline void unlock_vector_lock(void) {} 159static inline void unlock_vector_lock(void) {}
160#endif /* CONFIG_X86_LOCAL_APIC */ 160#endif /* CONFIG_X86_LOCAL_APIC */
161 161
162/* IOAPIC */
163#ifdef CONFIG_X86_IO_APIC
164struct io_apic_irq_attr {
165 int ioapic;
166 int ioapic_pin;
167 int trigger;
168 int polarity;
169};
170
171static inline void set_io_apic_irq_attr(struct io_apic_irq_attr *irq_attr,
172 int ioapic, int ioapic_pin,
173 int trigger, int polarity)
174{
175 irq_attr->ioapic = ioapic;
176 irq_attr->ioapic_pin = ioapic_pin;
177 irq_attr->trigger = trigger;
178 irq_attr->polarity = polarity;
179}
180
181extern void setup_IO_APIC(void);
182extern void enable_IO_APIC(void);
183extern void disable_IO_APIC(void);
184extern void setup_ioapic_dest(void);
185extern int IO_APIC_get_PCI_irq_vector(int bus, int devfn, int pin);
186extern void print_IO_APICs(void);
187
188extern unsigned long io_apic_irqs;
189#define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1 << (x)) & io_apic_irqs))
190#else /* CONFIG_X86_IO_APIC */
191#define IO_APIC_IRQ(x) 0
192static inline void print_IO_APICs(void) {}
193#endif /* CONFIG_X86_IO_APIC */
194
195/* Statistics */ 162/* Statistics */
196extern atomic_t irq_err_count; 163extern atomic_t irq_err_count;
197extern atomic_t irq_mis_count; 164extern atomic_t irq_mis_count;
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index bdd45c25023a..b7f1499d177f 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -132,6 +132,10 @@ extern int noioapicquirk;
132/* -1 if "noapic" boot option passed */ 132/* -1 if "noapic" boot option passed */
133extern int noioapicreroute; 133extern int noioapicreroute;
134 134
135extern unsigned long io_apic_irqs;
136
137#define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1 << (x)) & io_apic_irqs))
138
135/* 139/*
136 * If we use the IO-APIC for IRQ routing, disable automatic 140 * If we use the IO-APIC for IRQ routing, disable automatic
137 * assignment of PCI IRQ's. 141 * assignment of PCI IRQ's.
@@ -139,7 +143,6 @@ extern int noioapicreroute;
139#define io_apic_assign_pci_irqs \ 143#define io_apic_assign_pci_irqs \
140 (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs) 144 (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs)
141 145
142struct io_apic_irq_attr;
143struct irq_cfg; 146struct irq_cfg;
144extern void ioapic_insert_resources(void); 147extern void ioapic_insert_resources(void);
145 148
@@ -157,6 +160,13 @@ extern int restore_ioapic_entries(void);
157extern void setup_ioapic_ids_from_mpc(void); 160extern void setup_ioapic_ids_from_mpc(void);
158extern void setup_ioapic_ids_from_mpc_nocheck(void); 161extern void setup_ioapic_ids_from_mpc_nocheck(void);
159 162
163struct io_apic_irq_attr {
164 int ioapic;
165 int ioapic_pin;
166 int trigger;
167 int polarity;
168};
169
160enum ioapic_domain_type { 170enum ioapic_domain_type {
161 IOAPIC_DOMAIN_INVALID, 171 IOAPIC_DOMAIN_INVALID,
162 IOAPIC_DOMAIN_LEGACY, 172 IOAPIC_DOMAIN_LEGACY,
@@ -226,11 +236,19 @@ static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned
226 236
227extern void io_apic_eoi(unsigned int apic, unsigned int vector); 237extern void io_apic_eoi(unsigned int apic, unsigned int vector);
228 238
239extern void setup_IO_APIC(void);
240extern void enable_IO_APIC(void);
241extern void disable_IO_APIC(void);
242extern void setup_ioapic_dest(void);
243extern int IO_APIC_get_PCI_irq_vector(int bus, int devfn, int pin);
244extern void print_IO_APICs(void);
229#else /* !CONFIG_X86_IO_APIC */ 245#else /* !CONFIG_X86_IO_APIC */
230 246
247#define IO_APIC_IRQ(x) 0
231#define io_apic_assign_pci_irqs 0 248#define io_apic_assign_pci_irqs 0
232#define setup_ioapic_ids_from_mpc x86_init_noop 249#define setup_ioapic_ids_from_mpc x86_init_noop
233static inline void ioapic_insert_resources(void) { } 250static inline void ioapic_insert_resources(void) { }
251static inline void print_IO_APICs(void) {}
234#define gsi_top (NR_IRQS_LEGACY) 252#define gsi_top (NR_IRQS_LEGACY)
235static inline int mp_find_ioapic(u32 gsi) { return 0; } 253static inline int mp_find_ioapic(u32 gsi) { return 0; }
236static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; } 254static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; }
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index b1acb68e19c7..8dcdb7b1e848 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3023,6 +3023,16 @@ int mp_ioapic_registered(u32 gsi_base)
3023 return 0; 3023 return 0;
3024} 3024}
3025 3025
3026static inline void set_io_apic_irq_attr(struct io_apic_irq_attr *irq_attr,
3027 int ioapic, int ioapic_pin,
3028 int trigger, int polarity)
3029{
3030 irq_attr->ioapic = ioapic;
3031 irq_attr->ioapic_pin = ioapic_pin;
3032 irq_attr->trigger = trigger;
3033 irq_attr->polarity = polarity;
3034}
3035
3026int mp_irqdomain_map(struct irq_domain *domain, unsigned int virq, 3036int mp_irqdomain_map(struct irq_domain *domain, unsigned int virq,
3027 irq_hw_number_t hwirq) 3037 irq_hw_number_t hwirq)
3028{ 3038{
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index f5ab56d14287..aceb2f90c716 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -28,6 +28,7 @@
28#include <asm/nmi.h> 28#include <asm/nmi.h>
29#include <asm/hw_irq.h> 29#include <asm/hw_irq.h>
30#include <asm/apic.h> 30#include <asm/apic.h>
31#include <asm/io_apic.h>
31#include <asm/hpet.h> 32#include <asm/hpet.h>
32#include <linux/kdebug.h> 33#include <linux/kdebug.h>
33#include <asm/cpu.h> 34#include <asm/cpu.h>
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
index 72e8e310258d..469b23d6acc2 100644
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
@@ -20,6 +20,7 @@
20#include <asm/tlbflush.h> 20#include <asm/tlbflush.h>
21#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
22#include <asm/apic.h> 22#include <asm/apic.h>
23#include <asm/io_apic.h>
23#include <asm/cpufeature.h> 24#include <asm/cpufeature.h>
24#include <asm/desc.h> 25#include <asm/desc.h>
25#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 485981059a40..415480d3ea84 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -22,6 +22,7 @@
22#include <asm/pgtable.h> 22#include <asm/pgtable.h>
23#include <asm/tlbflush.h> 23#include <asm/tlbflush.h>
24#include <asm/mmu_context.h> 24#include <asm/mmu_context.h>
25#include <asm/io_apic.h>
25#include <asm/debugreg.h> 26#include <asm/debugreg.h>
26#include <asm/kexec-bzimage64.h> 27#include <asm/kexec-bzimage64.h>
27 28
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 17962e667a91..bae6c609888e 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -12,6 +12,7 @@
12#include <acpi/reboot.h> 12#include <acpi/reboot.h>
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/apic.h> 14#include <asm/apic.h>
15#include <asm/io_apic.h>
15#include <asm/desc.h> 16#include <asm/desc.h>
16#include <asm/hpet.h> 17#include <asm/hpet.h>
17#include <asm/pgtable.h> 18#include <asm/pgtable.h>