aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-23 07:00:56 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-02-23 11:26:49 -0500
commitff973d041e5ab9ada9e49f4e93ef3a699c511463 (patch)
treef5fee6d9934d98df18cdeb571a200ddc83562f28 /arch
parented972ccf434a9881a5881915ae04602af2776bad (diff)
x86: ioapic: Add io_apic_setup_irq_pin()
There are about four places in the ioapic code which do exactly the same setup sequence. Also the OF based ioapic setup needs that function to avoid putting the OF specific code into ioapic.c Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/io_apic.h2
-rw-r--r--arch/x86/kernel/apic/io_apic.c15
2 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index 56dcf08bde62..37dbb3fae395 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -151,6 +151,8 @@ void setup_IO_APIC_irq_extra(u32 gsi);
151extern void ioapic_and_gsi_init(void); 151extern void ioapic_and_gsi_init(void);
152extern void ioapic_insert_resources(void); 152extern void ioapic_insert_resources(void);
153 153
154int io_apic_setup_irq_pin(unsigned int irq, int node, struct io_apic_irq_attr *attr);
155
154extern struct IO_APIC_route_entry **alloc_ioapic_entries(void); 156extern struct IO_APIC_route_entry **alloc_ioapic_entries(void);
155extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries); 157extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries);
156extern int save_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries); 158extern int save_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries);
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index f751a82d4cb4..6deb3ca62fd6 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3607,6 +3607,21 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
3607} 3607}
3608#endif /* CONFIG_HT_IRQ */ 3608#endif /* CONFIG_HT_IRQ */
3609 3609
3610int
3611io_apic_setup_irq_pin(unsigned int irq, int node, struct io_apic_irq_attr *attr)
3612{
3613 struct irq_cfg *cfg = alloc_irq_and_cfg_at(irq, node);
3614 int ret;
3615
3616 if (!cfg)
3617 return -EINVAL;
3618 ret = __add_pin_to_irq_node(cfg, node, attr->ioapic, attr->ioapic_pin);
3619 if (!ret)
3620 setup_ioapic_irq(attr->ioapic, attr->ioapic_pin, irq, cfg,
3621 attr->trigger, attr->polarity);
3622 return ret;
3623}
3624
3610int __init io_apic_get_redir_entries (int ioapic) 3625int __init io_apic_get_redir_entries (int ioapic)
3611{ 3626{
3612 union IO_APIC_reg_01 reg_01; 3627 union IO_APIC_reg_01 reg_01;