aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic
diff options
context:
space:
mode:
authorJoerg Roedel <joro@8bytes.org>2012-09-26 06:44:45 -0400
committerJoerg Roedel <joro@8bytes.org>2013-01-28 06:17:27 -0500
commit9b1b0e42f54bc452817f4bb6a8d939afe4f04303 (patch)
tree9b3edc203e3ac5b23c5202605f5c4a9dbe023c03 /arch/x86/kernel/apic
parent819508d302e5b6d6dacb5c3d5e4756091e32cc7d (diff)
x86, io-apic: Move CONFIG_IRQ_REMAP code out of x86 core
Move all the code to either to the header file asm/irq_remapping.h or to drivers/iommu/. Signed-off-by: Joerg Roedel <joro@8bytes.org> Acked-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r--arch/x86/kernel/apic/io_apic.c44
1 files changed, 1 insertions, 43 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index ee0757db34ec..0fd5f30bac7f 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -68,22 +68,6 @@
68#define for_each_irq_pin(entry, head) \ 68#define for_each_irq_pin(entry, head) \
69 for (entry = head; entry; entry = entry->next) 69 for (entry = head; entry; entry = entry->next)
70 70
71#ifdef CONFIG_IRQ_REMAP
72static void irq_remap_modify_chip_defaults(struct irq_chip *chip);
73static inline bool irq_remapped(struct irq_cfg *cfg)
74{
75 return cfg->irq_2_iommu.iommu != NULL;
76}
77#else
78static inline bool irq_remapped(struct irq_cfg *cfg)
79{
80 return false;
81}
82static inline void irq_remap_modify_chip_defaults(struct irq_chip *chip)
83{
84}
85#endif
86
87/* 71/*
88 * Is the SiS APIC rmw bug present ? 72 * Is the SiS APIC rmw bug present ?
89 * -1 = don't know, 0 = no, 1 = yes 73 * -1 = don't know, 0 = no, 1 = yes
@@ -606,7 +590,7 @@ static void __eoi_ioapic_pin(int apic, int pin, int vector, struct irq_cfg *cfg)
606 } 590 }
607} 591}
608 592
609static void eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg) 593void eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg)
610{ 594{
611 struct irq_pin_list *entry; 595 struct irq_pin_list *entry;
612 unsigned long flags; 596 unsigned long flags;
@@ -2542,32 +2526,6 @@ static void ack_apic_level(struct irq_data *data)
2542 ioapic_irqd_unmask(data, cfg, masked); 2526 ioapic_irqd_unmask(data, cfg, masked);
2543} 2527}
2544 2528
2545#ifdef CONFIG_IRQ_REMAP
2546static void ir_ack_apic_edge(struct irq_data *data)
2547{
2548 ack_APIC_irq();
2549}
2550
2551static void ir_ack_apic_level(struct irq_data *data)
2552{
2553 ack_APIC_irq();
2554 eoi_ioapic_irq(data->irq, data->chip_data);
2555}
2556
2557static void ir_print_prefix(struct irq_data *data, struct seq_file *p)
2558{
2559 seq_printf(p, " IR-%s", data->chip->name);
2560}
2561
2562static void irq_remap_modify_chip_defaults(struct irq_chip *chip)
2563{
2564 chip->irq_print_chip = ir_print_prefix;
2565 chip->irq_ack = ir_ack_apic_edge;
2566 chip->irq_eoi = ir_ack_apic_level;
2567 chip->irq_set_affinity = x86_io_apic_ops.set_affinity;
2568}
2569#endif /* CONFIG_IRQ_REMAP */
2570
2571static struct irq_chip ioapic_chip __read_mostly = { 2529static struct irq_chip ioapic_chip __read_mostly = {
2572 .name = "IO-APIC", 2530 .name = "IO-APIC",
2573 .irq_startup = startup_ioapic_irq, 2531 .irq_startup = startup_ioapic_irq,