|
@@ -76,10 +76,12 @@ int sis_apic_bug = -1;
|
|
static DEFINE_RAW_SPINLOCK(ioapic_lock);
|
|
static DEFINE_RAW_SPINLOCK(ioapic_lock);
|
|
static DEFINE_RAW_SPINLOCK(vector_lock);
|
|
static DEFINE_RAW_SPINLOCK(vector_lock);
|
|
|
|
|
|
-/*
|
|
|
|
- * # of IRQ routing registers
|
|
|
|
- */
|
|
|
|
-int nr_ioapic_registers[MAX_IO_APICS];
|
|
|
|
|
|
+static struct ioapic {
|
|
|
|
+ /*
|
|
|
|
+ * # of IRQ routing registers
|
|
|
|
+ */
|
|
|
|
+ int nr_registers;
|
|
|
|
+} ioapics[MAX_IO_APICS];
|
|
|
|
|
|
/* I/O APIC entries */
|
|
/* I/O APIC entries */
|
|
struct mpc_ioapic mp_ioapics[MAX_IO_APICS];
|
|
struct mpc_ioapic mp_ioapics[MAX_IO_APICS];
|
|
@@ -187,7 +189,7 @@ int __init arch_early_irq_init(void)
|
|
for (i = 0; i < nr_ioapics; i++) {
|
|
for (i = 0; i < nr_ioapics; i++) {
|
|
ioapic_saved_data[i] =
|
|
ioapic_saved_data[i] =
|
|
kzalloc(sizeof(struct IO_APIC_route_entry) *
|
|
kzalloc(sizeof(struct IO_APIC_route_entry) *
|
|
- nr_ioapic_registers[i], GFP_KERNEL);
|
|
|
|
|
|
+ ioapics[i].nr_registers, GFP_KERNEL);
|
|
if (!ioapic_saved_data[i])
|
|
if (!ioapic_saved_data[i])
|
|
pr_err("IOAPIC %d: suspend/resume impossible!\n", i);
|
|
pr_err("IOAPIC %d: suspend/resume impossible!\n", i);
|
|
}
|
|
}
|
|
@@ -586,7 +588,7 @@ static void clear_IO_APIC (void)
|
|
int apic, pin;
|
|
int apic, pin;
|
|
|
|
|
|
for (apic = 0; apic < nr_ioapics; apic++)
|
|
for (apic = 0; apic < nr_ioapics; apic++)
|
|
- for (pin = 0; pin < nr_ioapic_registers[apic]; pin++)
|
|
|
|
|
|
+ for (pin = 0; pin < ioapics[apic].nr_registers; pin++)
|
|
clear_IO_APIC_pin(apic, pin);
|
|
clear_IO_APIC_pin(apic, pin);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -642,7 +644,7 @@ int save_ioapic_entries(void)
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
- for (pin = 0; pin < nr_ioapic_registers[apic]; pin++)
|
|
|
|
|
|
+ for (pin = 0; pin < ioapics[apic].nr_registers; pin++)
|
|
ioapic_saved_data[apic][pin] =
|
|
ioapic_saved_data[apic][pin] =
|
|
ioapic_read_entry(apic, pin);
|
|
ioapic_read_entry(apic, pin);
|
|
}
|
|
}
|
|
@@ -661,7 +663,7 @@ void mask_ioapic_entries(void)
|
|
if (!ioapic_saved_data[apic])
|
|
if (!ioapic_saved_data[apic])
|
|
continue;
|
|
continue;
|
|
|
|
|
|
- for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) {
|
|
|
|
|
|
+ for (pin = 0; pin < ioapics[apic].nr_registers; pin++) {
|
|
struct IO_APIC_route_entry entry;
|
|
struct IO_APIC_route_entry entry;
|
|
|
|
|
|
entry = ioapic_saved_data[apic][pin];
|
|
entry = ioapic_saved_data[apic][pin];
|
|
@@ -684,7 +686,7 @@ int restore_ioapic_entries(void)
|
|
if (!ioapic_saved_data[apic])
|
|
if (!ioapic_saved_data[apic])
|
|
continue;
|
|
continue;
|
|
|
|
|
|
- for (pin = 0; pin < nr_ioapic_registers[apic]; pin++)
|
|
|
|
|
|
+ for (pin = 0; pin < ioapics[apic].nr_registers; pin++)
|
|
ioapic_write_entry(apic, pin,
|
|
ioapic_write_entry(apic, pin,
|
|
ioapic_saved_data[apic][pin]);
|
|
ioapic_saved_data[apic][pin]);
|
|
}
|
|
}
|
|
@@ -1191,7 +1193,7 @@ static inline int IO_APIC_irq_trigger(int irq)
|
|
int apic, idx, pin;
|
|
int apic, idx, pin;
|
|
|
|
|
|
for (apic = 0; apic < nr_ioapics; apic++) {
|
|
for (apic = 0; apic < nr_ioapics; apic++) {
|
|
- for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) {
|
|
|
|
|
|
+ for (pin = 0; pin < ioapics[apic].nr_registers; pin++) {
|
|
idx = find_irq_entry(apic, pin, mp_INT);
|
|
idx = find_irq_entry(apic, pin, mp_INT);
|
|
if ((idx != -1) && (irq == pin_2_irq(idx, apic, pin)))
|
|
if ((idx != -1) && (irq == pin_2_irq(idx, apic, pin)))
|
|
return irq_trigger(idx);
|
|
return irq_trigger(idx);
|
|
@@ -1358,7 +1360,7 @@ static void __init __io_apic_setup_irqs(unsigned int apic_id)
|
|
struct io_apic_irq_attr attr;
|
|
struct io_apic_irq_attr attr;
|
|
unsigned int pin, irq;
|
|
unsigned int pin, irq;
|
|
|
|
|
|
- for (pin = 0; pin < nr_ioapic_registers[apic_id]; pin++) {
|
|
|
|
|
|
+ for (pin = 0; pin < ioapics[apic_id].nr_registers; pin++) {
|
|
idx = find_irq_entry(apic_id, pin, mp_INT);
|
|
idx = find_irq_entry(apic_id, pin, mp_INT);
|
|
if (io_apic_pin_not_connected(idx, apic_id, pin))
|
|
if (io_apic_pin_not_connected(idx, apic_id, pin))
|
|
continue;
|
|
continue;
|
|
@@ -1480,7 +1482,7 @@ __apicdebuginit(void) print_IO_APIC(void)
|
|
printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
|
|
printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
|
|
for (i = 0; i < nr_ioapics; i++)
|
|
for (i = 0; i < nr_ioapics; i++)
|
|
printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n",
|
|
printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n",
|
|
- mp_ioapics[i].apicid, nr_ioapic_registers[i]);
|
|
|
|
|
|
+ mp_ioapics[i].apicid, ioapics[i].nr_registers);
|
|
|
|
|
|
/*
|
|
/*
|
|
* We are a bit conservative about what we expect. We have to
|
|
* We are a bit conservative about what we expect. We have to
|
|
@@ -1794,7 +1796,7 @@ void __init enable_IO_APIC(void)
|
|
for(apic = 0; apic < nr_ioapics; apic++) {
|
|
for(apic = 0; apic < nr_ioapics; apic++) {
|
|
int pin;
|
|
int pin;
|
|
/* See if any of the pins is in ExtINT mode */
|
|
/* See if any of the pins is in ExtINT mode */
|
|
- for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) {
|
|
|
|
|
|
+ for (pin = 0; pin < ioapics[apic].nr_registers; pin++) {
|
|
struct IO_APIC_route_entry entry;
|
|
struct IO_APIC_route_entry entry;
|
|
entry = ioapic_read_entry(apic, pin);
|
|
entry = ioapic_read_entry(apic, pin);
|
|
|
|
|
|
@@ -3754,7 +3756,7 @@ void __init setup_ioapic_dest(void)
|
|
return;
|
|
return;
|
|
|
|
|
|
for (ioapic = 0; ioapic < nr_ioapics; ioapic++)
|
|
for (ioapic = 0; ioapic < nr_ioapics; ioapic++)
|
|
- for (pin = 0; pin < nr_ioapic_registers[ioapic]; pin++) {
|
|
|
|
|
|
+ for (pin = 0; pin < ioapics[ioapic].nr_registers; pin++) {
|
|
irq_entry = find_irq_entry(ioapic, pin, mp_INT);
|
|
irq_entry = find_irq_entry(ioapic, pin, mp_INT);
|
|
if (irq_entry == -1)
|
|
if (irq_entry == -1)
|
|
continue;
|
|
continue;
|
|
@@ -3948,7 +3950,7 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
|
|
/*
|
|
/*
|
|
* The number of IO-APIC IRQ registers (== #pins):
|
|
* The number of IO-APIC IRQ registers (== #pins):
|
|
*/
|
|
*/
|
|
- nr_ioapic_registers[idx] = entries;
|
|
|
|
|
|
+ ioapics[idx].nr_registers = entries;
|
|
|
|
|
|
if (mp_gsi_routing[idx].gsi_end >= gsi_top)
|
|
if (mp_gsi_routing[idx].gsi_end >= gsi_top)
|
|
gsi_top = mp_gsi_routing[idx].gsi_end + 1;
|
|
gsi_top = mp_gsi_routing[idx].gsi_end + 1;
|