|
@@ -72,7 +72,7 @@ int sis_apic_bug = -1;
|
|
int nr_ioapic_registers[MAX_IO_APICS];
|
|
int nr_ioapic_registers[MAX_IO_APICS];
|
|
|
|
|
|
/* I/O APIC entries */
|
|
/* I/O APIC entries */
|
|
-struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS];
|
|
|
|
|
|
+struct mp_config_ioapic mp_ioapics[MAX_IO_APICS];
|
|
int nr_ioapics;
|
|
int nr_ioapics;
|
|
|
|
|
|
/* MP IRQ source entries */
|
|
/* MP IRQ source entries */
|
|
@@ -110,7 +110,7 @@ struct io_apic {
|
|
static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx)
|
|
static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx)
|
|
{
|
|
{
|
|
return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx)
|
|
return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx)
|
|
- + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK);
|
|
|
|
|
|
+ + (mp_ioapics[idx].mp_apicaddr & ~PAGE_MASK);
|
|
}
|
|
}
|
|
|
|
|
|
static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
|
|
static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
|
|
@@ -802,7 +802,7 @@ static int find_irq_entry(int apic, int pin, int type)
|
|
|
|
|
|
for (i = 0; i < mp_irq_entries; i++)
|
|
for (i = 0; i < mp_irq_entries; i++)
|
|
if (mp_irqs[i].mpc_irqtype == type &&
|
|
if (mp_irqs[i].mpc_irqtype == type &&
|
|
- (mp_irqs[i].mpc_dstapic == mp_ioapics[apic].mpc_apicid ||
|
|
|
|
|
|
+ (mp_irqs[i].mpc_dstapic == mp_ioapics[apic].mp_apicid ||
|
|
mp_irqs[i].mpc_dstapic == MP_APIC_ALL) &&
|
|
mp_irqs[i].mpc_dstapic == MP_APIC_ALL) &&
|
|
mp_irqs[i].mpc_dstirq == pin)
|
|
mp_irqs[i].mpc_dstirq == pin)
|
|
return i;
|
|
return i;
|
|
@@ -844,7 +844,7 @@ static int __init find_isa_irq_apic(int irq, int type)
|
|
if (i < mp_irq_entries) {
|
|
if (i < mp_irq_entries) {
|
|
int apic;
|
|
int apic;
|
|
for(apic = 0; apic < nr_ioapics; apic++) {
|
|
for(apic = 0; apic < nr_ioapics; apic++) {
|
|
- if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic)
|
|
|
|
|
|
+ if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mpc_dstapic)
|
|
return apic;
|
|
return apic;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -872,7 +872,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin)
|
|
int lbus = mp_irqs[i].mpc_srcbus;
|
|
int lbus = mp_irqs[i].mpc_srcbus;
|
|
|
|
|
|
for (apic = 0; apic < nr_ioapics; apic++)
|
|
for (apic = 0; apic < nr_ioapics; apic++)
|
|
- if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic ||
|
|
|
|
|
|
+ if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mpc_dstapic ||
|
|
mp_irqs[i].mpc_dstapic == MP_APIC_ALL)
|
|
mp_irqs[i].mpc_dstapic == MP_APIC_ALL)
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -1250,12 +1250,12 @@ static void __init setup_IO_APIC_irqs(void)
|
|
if (first_notcon) {
|
|
if (first_notcon) {
|
|
apic_printk(APIC_VERBOSE, KERN_DEBUG
|
|
apic_printk(APIC_VERBOSE, KERN_DEBUG
|
|
" IO-APIC (apicid-pin) %d-%d",
|
|
" IO-APIC (apicid-pin) %d-%d",
|
|
- mp_ioapics[apic].mpc_apicid,
|
|
|
|
|
|
+ mp_ioapics[apic].mp_apicid,
|
|
pin);
|
|
pin);
|
|
first_notcon = 0;
|
|
first_notcon = 0;
|
|
} else
|
|
} else
|
|
apic_printk(APIC_VERBOSE, ", %d-%d",
|
|
apic_printk(APIC_VERBOSE, ", %d-%d",
|
|
- mp_ioapics[apic].mpc_apicid, pin);
|
|
|
|
|
|
+ mp_ioapics[apic].mp_apicid, pin);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1357,7 +1357,7 @@ void __init 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].mpc_apicid, nr_ioapic_registers[i]);
|
|
|
|
|
|
+ mp_ioapics[i].mp_apicid, nr_ioapic_registers[i]);
|
|
|
|
|
|
/*
|
|
/*
|
|
* We are a bit conservative about what we expect. We have to
|
|
* We are a bit conservative about what we expect. We have to
|
|
@@ -1376,7 +1376,7 @@ void __init print_IO_APIC(void)
|
|
reg_03.raw = io_apic_read(apic, 3);
|
|
reg_03.raw = io_apic_read(apic, 3);
|
|
spin_unlock_irqrestore(&ioapic_lock, flags);
|
|
spin_unlock_irqrestore(&ioapic_lock, flags);
|
|
|
|
|
|
- printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].mpc_apicid);
|
|
|
|
|
|
+ printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].mp_apicid);
|
|
printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw);
|
|
printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw);
|
|
printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID);
|
|
printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID);
|
|
printk(KERN_DEBUG "....... : Delivery Type: %X\n", reg_00.bits.delivery_type);
|
|
printk(KERN_DEBUG "....... : Delivery Type: %X\n", reg_00.bits.delivery_type);
|
|
@@ -1749,14 +1749,14 @@ static void __init setup_ioapic_ids_from_mpc(void)
|
|
reg_00.raw = io_apic_read(apic, 0);
|
|
reg_00.raw = io_apic_read(apic, 0);
|
|
spin_unlock_irqrestore(&ioapic_lock, flags);
|
|
spin_unlock_irqrestore(&ioapic_lock, flags);
|
|
|
|
|
|
- old_id = mp_ioapics[apic].mpc_apicid;
|
|
|
|
|
|
+ old_id = mp_ioapics[apic].mp_apicid;
|
|
|
|
|
|
- if (mp_ioapics[apic].mpc_apicid >= get_physical_broadcast()) {
|
|
|
|
|
|
+ if (mp_ioapics[apic].mp_apicid >= get_physical_broadcast()) {
|
|
printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n",
|
|
printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n",
|
|
- apic, mp_ioapics[apic].mpc_apicid);
|
|
|
|
|
|
+ apic, mp_ioapics[apic].mp_apicid);
|
|
printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
|
|
printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
|
|
reg_00.bits.ID);
|
|
reg_00.bits.ID);
|
|
- mp_ioapics[apic].mpc_apicid = reg_00.bits.ID;
|
|
|
|
|
|
+ mp_ioapics[apic].mp_apicid = reg_00.bits.ID;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -1765,9 +1765,9 @@ static void __init setup_ioapic_ids_from_mpc(void)
|
|
* 'stuck on smp_invalidate_needed IPI wait' messages.
|
|
* 'stuck on smp_invalidate_needed IPI wait' messages.
|
|
*/
|
|
*/
|
|
if (check_apicid_used(phys_id_present_map,
|
|
if (check_apicid_used(phys_id_present_map,
|
|
- mp_ioapics[apic].mpc_apicid)) {
|
|
|
|
|
|
+ mp_ioapics[apic].mp_apicid)) {
|
|
printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
|
|
printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
|
|
- apic, mp_ioapics[apic].mpc_apicid);
|
|
|
|
|
|
+ apic, mp_ioapics[apic].mp_apicid);
|
|
for (i = 0; i < get_physical_broadcast(); i++)
|
|
for (i = 0; i < get_physical_broadcast(); i++)
|
|
if (!physid_isset(i, phys_id_present_map))
|
|
if (!physid_isset(i, phys_id_present_map))
|
|
break;
|
|
break;
|
|
@@ -1776,13 +1776,13 @@ static void __init setup_ioapic_ids_from_mpc(void)
|
|
printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
|
|
printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
|
|
i);
|
|
i);
|
|
physid_set(i, phys_id_present_map);
|
|
physid_set(i, phys_id_present_map);
|
|
- mp_ioapics[apic].mpc_apicid = i;
|
|
|
|
|
|
+ mp_ioapics[apic].mp_apicid = i;
|
|
} else {
|
|
} else {
|
|
physid_mask_t tmp;
|
|
physid_mask_t tmp;
|
|
- tmp = apicid_to_cpu_present(mp_ioapics[apic].mpc_apicid);
|
|
|
|
|
|
+ tmp = apicid_to_cpu_present(mp_ioapics[apic].mp_apicid);
|
|
apic_printk(APIC_VERBOSE, "Setting %d in the "
|
|
apic_printk(APIC_VERBOSE, "Setting %d in the "
|
|
"phys_id_present_map\n",
|
|
"phys_id_present_map\n",
|
|
- mp_ioapics[apic].mpc_apicid);
|
|
|
|
|
|
+ mp_ioapics[apic].mp_apicid);
|
|
physids_or(phys_id_present_map, phys_id_present_map, tmp);
|
|
physids_or(phys_id_present_map, phys_id_present_map, tmp);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1791,11 +1791,11 @@ static void __init setup_ioapic_ids_from_mpc(void)
|
|
* We need to adjust the IRQ routing table
|
|
* We need to adjust the IRQ routing table
|
|
* if the ID changed.
|
|
* if the ID changed.
|
|
*/
|
|
*/
|
|
- if (old_id != mp_ioapics[apic].mpc_apicid)
|
|
|
|
|
|
+ if (old_id != mp_ioapics[apic].mp_apicid)
|
|
for (i = 0; i < mp_irq_entries; i++)
|
|
for (i = 0; i < mp_irq_entries; i++)
|
|
if (mp_irqs[i].mpc_dstapic == old_id)
|
|
if (mp_irqs[i].mpc_dstapic == old_id)
|
|
mp_irqs[i].mpc_dstapic
|
|
mp_irqs[i].mpc_dstapic
|
|
- = mp_ioapics[apic].mpc_apicid;
|
|
|
|
|
|
+ = mp_ioapics[apic].mp_apicid;
|
|
|
|
|
|
/*
|
|
/*
|
|
* Read the right value from the MPC table and
|
|
* Read the right value from the MPC table and
|
|
@@ -1803,9 +1803,9 @@ static void __init setup_ioapic_ids_from_mpc(void)
|
|
*/
|
|
*/
|
|
apic_printk(APIC_VERBOSE, KERN_INFO
|
|
apic_printk(APIC_VERBOSE, KERN_INFO
|
|
"...changing IO-APIC physical APIC ID to %d ...",
|
|
"...changing IO-APIC physical APIC ID to %d ...",
|
|
- mp_ioapics[apic].mpc_apicid);
|
|
|
|
|
|
+ mp_ioapics[apic].mp_apicid);
|
|
|
|
|
|
- reg_00.bits.ID = mp_ioapics[apic].mpc_apicid;
|
|
|
|
|
|
+ reg_00.bits.ID = mp_ioapics[apic].mp_apicid;
|
|
spin_lock_irqsave(&ioapic_lock, flags);
|
|
spin_lock_irqsave(&ioapic_lock, flags);
|
|
io_apic_write(apic, 0, reg_00.raw);
|
|
io_apic_write(apic, 0, reg_00.raw);
|
|
spin_unlock_irqrestore(&ioapic_lock, flags);
|
|
spin_unlock_irqrestore(&ioapic_lock, flags);
|
|
@@ -1816,7 +1816,7 @@ static void __init setup_ioapic_ids_from_mpc(void)
|
|
spin_lock_irqsave(&ioapic_lock, flags);
|
|
spin_lock_irqsave(&ioapic_lock, flags);
|
|
reg_00.raw = io_apic_read(apic, 0);
|
|
reg_00.raw = io_apic_read(apic, 0);
|
|
spin_unlock_irqrestore(&ioapic_lock, flags);
|
|
spin_unlock_irqrestore(&ioapic_lock, flags);
|
|
- if (reg_00.bits.ID != mp_ioapics[apic].mpc_apicid)
|
|
|
|
|
|
+ if (reg_00.bits.ID != mp_ioapics[apic].mp_apicid)
|
|
printk("could not set ID!\n");
|
|
printk("could not set ID!\n");
|
|
else
|
|
else
|
|
apic_printk(APIC_VERBOSE, " ok.\n");
|
|
apic_printk(APIC_VERBOSE, " ok.\n");
|
|
@@ -2355,8 +2355,8 @@ static int ioapic_resume(struct sys_device *dev)
|
|
|
|
|
|
spin_lock_irqsave(&ioapic_lock, flags);
|
|
spin_lock_irqsave(&ioapic_lock, flags);
|
|
reg_00.raw = io_apic_read(dev->id, 0);
|
|
reg_00.raw = io_apic_read(dev->id, 0);
|
|
- if (reg_00.bits.ID != mp_ioapics[dev->id].mpc_apicid) {
|
|
|
|
- reg_00.bits.ID = mp_ioapics[dev->id].mpc_apicid;
|
|
|
|
|
|
+ if (reg_00.bits.ID != mp_ioapics[dev->id].mp_apicid) {
|
|
|
|
+ reg_00.bits.ID = mp_ioapics[dev->id].mp_apicid;
|
|
io_apic_write(dev->id, 0, reg_00.raw);
|
|
io_apic_write(dev->id, 0, reg_00.raw);
|
|
}
|
|
}
|
|
spin_unlock_irqrestore(&ioapic_lock, flags);
|
|
spin_unlock_irqrestore(&ioapic_lock, flags);
|
|
@@ -2789,7 +2789,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
|
|
|
|
|
|
apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
|
|
apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
|
|
"(%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
|
|
"(%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
|
|
- mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
|
|
|
|
|
|
+ mp_ioapics[ioapic].mp_apicid, pin, entry.vector, irq,
|
|
edge_level, active_high_low);
|
|
edge_level, active_high_low);
|
|
|
|
|
|
ioapic_register_intr(irq, entry.vector, edge_level);
|
|
ioapic_register_intr(irq, entry.vector, edge_level);
|