提交 154d9e50 编写于 作者: J Jiang Liu 提交者: Thomas Gleixner

x86/irq: Clean up io_apic.h

Clean up io_apic.h by:
1) moving definition of struct mp_ioapic_gsi into io_apic.c
2) changing mp_pin_to_gsi() and mp_ioapic_gsi_routing() as static
3) removing unused MP_MAX_IOAPIC_PIN
4) removing useless forward declaration
5) removing useless comments
Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
Tested-by: NJoerg Roedel <jroedel@suse.de>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Cohen <david.a.cohen@linux.intel.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Grant Likely <grant.likely@linaro.org>
Link: http://lkml.kernel.org/r/1428978610-28986-20-git-send-email-jiang.liu@linux.intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 ca1b8862
...@@ -113,9 +113,6 @@ extern int nr_ioapics; ...@@ -113,9 +113,6 @@ extern int nr_ioapics;
extern int mpc_ioapic_id(int ioapic); extern int mpc_ioapic_id(int ioapic);
extern unsigned int mpc_ioapic_addr(int ioapic); extern unsigned int mpc_ioapic_addr(int ioapic);
extern struct mp_ioapic_gsi *mp_ioapic_gsi_routing(int ioapic);
#define MP_MAX_IOAPIC_PIN 127
/* # of MP IRQ source entries */ /* # of MP IRQ source entries */
extern int mp_irq_entries; extern int mp_irq_entries;
...@@ -135,6 +132,8 @@ extern int noioapicquirk; ...@@ -135,6 +132,8 @@ extern int noioapicquirk;
/* -1 if "noapic" boot option passed */ /* -1 if "noapic" boot option passed */
extern int noioapicreroute; extern int noioapicreroute;
extern u32 gsi_top;
extern unsigned long io_apic_irqs; extern unsigned long io_apic_irqs;
#define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1 << (x)) & io_apic_irqs)) #define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1 << (x)) & io_apic_irqs))
...@@ -174,15 +173,8 @@ struct ioapic_domain_cfg { ...@@ -174,15 +173,8 @@ struct ioapic_domain_cfg {
struct device_node *dev; struct device_node *dev;
}; };
struct mp_ioapic_gsi{
u32 gsi_base;
u32 gsi_end;
};
extern u32 gsi_top;
extern int mp_find_ioapic(u32 gsi); extern int mp_find_ioapic(u32 gsi);
extern int mp_find_ioapic_pin(int ioapic, u32 gsi); extern int mp_find_ioapic_pin(int ioapic, u32 gsi);
extern u32 mp_pin_to_gsi(int ioapic, int pin);
extern int mp_map_gsi_to_irq(u32 gsi, unsigned int flags, extern int mp_map_gsi_to_irq(u32 gsi, unsigned int flags,
struct irq_alloc_info *info); struct irq_alloc_info *info);
extern void mp_unmap_irq(int irq); extern void mp_unmap_irq(int irq);
...@@ -231,7 +223,6 @@ static inline int arch_early_ioapic_init(void) { return 0; } ...@@ -231,7 +223,6 @@ static inline int arch_early_ioapic_init(void) { return 0; }
static inline void print_IO_APICs(void) {} static inline void print_IO_APICs(void) {}
#define gsi_top (NR_IRQS_LEGACY) #define gsi_top (NR_IRQS_LEGACY)
static inline int mp_find_ioapic(u32 gsi) { return 0; } static inline int mp_find_ioapic(u32 gsi) { return 0; }
static inline u32 mp_pin_to_gsi(int ioapic, int pin) { return UINT_MAX; }
static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags, static inline int mp_map_gsi_to_irq(u32 gsi, unsigned int flags,
struct irq_alloc_info *info) struct irq_alloc_info *info)
{ {
......
...@@ -63,7 +63,6 @@ ...@@ -63,7 +63,6 @@
#define for_each_ioapic_pin(idx, pin) \ #define for_each_ioapic_pin(idx, pin) \
for_each_ioapic((idx)) \ for_each_ioapic((idx)) \
for_each_pin((idx), (pin)) for_each_pin((idx), (pin))
#define for_each_irq_pin(entry, head) \ #define for_each_irq_pin(entry, head) \
list_for_each_entry(entry, &head, list) list_for_each_entry(entry, &head, list)
...@@ -92,6 +91,11 @@ struct mp_chip_data { ...@@ -92,6 +91,11 @@ struct mp_chip_data {
bool isa_irq; bool isa_irq;
}; };
struct mp_ioapic_gsi {
u32 gsi_base;
u32 gsi_end;
};
static struct ioapic { static struct ioapic {
/* /*
* # of IRQ routing registers * # of IRQ routing registers
...@@ -122,7 +126,7 @@ unsigned int mpc_ioapic_addr(int ioapic_idx) ...@@ -122,7 +126,7 @@ unsigned int mpc_ioapic_addr(int ioapic_idx)
return ioapics[ioapic_idx].mp_config.apicaddr; return ioapics[ioapic_idx].mp_config.apicaddr;
} }
struct mp_ioapic_gsi *mp_ioapic_gsi_routing(int ioapic_idx) static inline struct mp_ioapic_gsi *mp_ioapic_gsi_routing(int ioapic_idx)
{ {
return &ioapics[ioapic_idx].gsi_config; return &ioapics[ioapic_idx].gsi_config;
} }
...@@ -134,7 +138,7 @@ static inline int mp_ioapic_pin_count(int ioapic) ...@@ -134,7 +138,7 @@ static inline int mp_ioapic_pin_count(int ioapic)
return gsi_cfg->gsi_end - gsi_cfg->gsi_base + 1; return gsi_cfg->gsi_end - gsi_cfg->gsi_base + 1;
} }
u32 mp_pin_to_gsi(int ioapic, int pin) static inline u32 mp_pin_to_gsi(int ioapic, int pin)
{ {
return mp_ioapic_gsi_routing(ioapic)->gsi_base + pin; return mp_ioapic_gsi_routing(ioapic)->gsi_base + pin;
} }
...@@ -1153,8 +1157,7 @@ static int pin_2_irq(int idx, int ioapic, int pin, unsigned int flags) ...@@ -1153,8 +1157,7 @@ static int pin_2_irq(int idx, int ioapic, int pin, unsigned int flags)
return mp_map_pin_to_irq(gsi, idx, ioapic, pin, flags, NULL); return mp_map_pin_to_irq(gsi, idx, ioapic, pin, flags, NULL);
} }
int mp_map_gsi_to_irq(u32 gsi, unsigned int flags, int mp_map_gsi_to_irq(u32 gsi, unsigned int flags, struct irq_alloc_info *info)
struct irq_alloc_info *info)
{ {
int ioapic, pin, idx; int ioapic, pin, idx;
...@@ -1719,7 +1722,6 @@ static int __init timer_irq_works(void) ...@@ -1719,7 +1722,6 @@ static int __init timer_irq_works(void)
* This is not complete - we should be able to fake * This is not complete - we should be able to fake
* an edge even if it isn't on the 8259A... * an edge even if it isn't on the 8259A...
*/ */
static unsigned int startup_ioapic_irq(struct irq_data *data) static unsigned int startup_ioapic_irq(struct irq_data *data)
{ {
int was_pending = 0, irq = data->irq; int was_pending = 0, irq = data->irq;
...@@ -1737,15 +1739,6 @@ static unsigned int startup_ioapic_irq(struct irq_data *data) ...@@ -1737,15 +1739,6 @@ static unsigned int startup_ioapic_irq(struct irq_data *data)
return was_pending; return was_pending;
} }
/*
* Level and edge triggered IO-APIC interrupts need different handling,
* so we use two separate IRQ descriptors. Edge triggered IRQs can be
* handled with the level-triggered descriptor, but that one has slightly
* more overhead. Level-triggered interrupts cannot be handled with the
* edge-triggered handler, without risking IRQ storms and other ugly
* races.
*/
static void __target_IO_APIC_irq(unsigned int irq, struct irq_cfg *cfg, static void __target_IO_APIC_irq(unsigned int irq, struct irq_cfg *cfg,
struct mp_chip_data *data) struct mp_chip_data *data)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册