aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/io_apic.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-27 18:14:11 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-28 17:20:06 -0500
commitc8d46cf06dc2e3a8f57a350eb9f9b19fd7f2ffe5 (patch)
treefe5ceac244165e5726f310027588cf6e1b6e60e6 /arch/x86/kernel/io_apic.c
parent6781d948cc05b02df915650f2eb49550a1631df9 (diff)
x86: rename 'genapic' to 'apic'
Rename genapic-> to apic-> references because in a future chagne we'll open-code all the indirect calls (instead of obscuring them via macros), so we want this reference to be as short as possible. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/io_apic.c')
-rw-r--r--arch/x86/kernel/io_apic.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index bfb7d734062a..7283234229fe 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -1486,7 +1486,7 @@ static void ioapic_register_intr(int irq, struct irq_desc *desc, unsigned long t
1486 handle_edge_irq, "edge"); 1486 handle_edge_irq, "edge");
1487} 1487}
1488 1488
1489static int setup_ioapic_entry(int apic, int irq, 1489static int setup_ioapic_entry(int apic_id, int irq,
1490 struct IO_APIC_route_entry *entry, 1490 struct IO_APIC_route_entry *entry,
1491 unsigned int destination, int trigger, 1491 unsigned int destination, int trigger,
1492 int polarity, int vector) 1492 int polarity, int vector)
@@ -1498,18 +1498,18 @@ static int setup_ioapic_entry(int apic, int irq,
1498 1498
1499#ifdef CONFIG_INTR_REMAP 1499#ifdef CONFIG_INTR_REMAP
1500 if (intr_remapping_enabled) { 1500 if (intr_remapping_enabled) {
1501 struct intel_iommu *iommu = map_ioapic_to_ir(apic); 1501 struct intel_iommu *iommu = map_ioapic_to_ir(apic_id);
1502 struct irte irte; 1502 struct irte irte;
1503 struct IR_IO_APIC_route_entry *ir_entry = 1503 struct IR_IO_APIC_route_entry *ir_entry =
1504 (struct IR_IO_APIC_route_entry *) entry; 1504 (struct IR_IO_APIC_route_entry *) entry;
1505 int index; 1505 int index;
1506 1506
1507 if (!iommu) 1507 if (!iommu)
1508 panic("No mapping iommu for ioapic %d\n", apic); 1508 panic("No mapping iommu for ioapic %d\n", apic_id);
1509 1509
1510 index = alloc_irte(iommu, irq, 1); 1510 index = alloc_irte(iommu, irq, 1);
1511 if (index < 0) 1511 if (index < 0)
1512 panic("Failed to allocate IRTE for ioapic %d\n", apic); 1512 panic("Failed to allocate IRTE for ioapic %d\n", apic_id);
1513 1513
1514 memset(&irte, 0, sizeof(irte)); 1514 memset(&irte, 0, sizeof(irte));
1515 1515
@@ -1547,7 +1547,7 @@ static int setup_ioapic_entry(int apic, int irq,
1547 return 0; 1547 return 0;
1548} 1548}
1549 1549
1550static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_desc *desc, 1550static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq_desc *desc,
1551 int trigger, int polarity) 1551 int trigger, int polarity)
1552{ 1552{
1553 struct irq_cfg *cfg; 1553 struct irq_cfg *cfg;
@@ -1567,14 +1567,14 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
1567 apic_printk(APIC_VERBOSE,KERN_DEBUG 1567 apic_printk(APIC_VERBOSE,KERN_DEBUG
1568 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> " 1568 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
1569 "IRQ %d Mode:%i Active:%i)\n", 1569 "IRQ %d Mode:%i Active:%i)\n",
1570 apic, mp_ioapics[apic].apicid, pin, cfg->vector, 1570 apic_id, mp_ioapics[apic_id].apicid, pin, cfg->vector,
1571 irq, trigger, polarity); 1571 irq, trigger, polarity);
1572 1572
1573 1573
1574 if (setup_ioapic_entry(mp_ioapics[apic].apicid, irq, &entry, 1574 if (setup_ioapic_entry(mp_ioapics[apic_id].apicid, irq, &entry,
1575 dest, trigger, polarity, cfg->vector)) { 1575 dest, trigger, polarity, cfg->vector)) {
1576 printk("Failed to setup ioapic entry for ioapic %d, pin %d\n", 1576 printk("Failed to setup ioapic entry for ioapic %d, pin %d\n",
1577 mp_ioapics[apic].apicid, pin); 1577 mp_ioapics[apic_id].apicid, pin);
1578 __clear_irq_vector(irq, cfg); 1578 __clear_irq_vector(irq, cfg);
1579 return; 1579 return;
1580 } 1580 }
@@ -1583,12 +1583,12 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
1583 if (irq < NR_IRQS_LEGACY) 1583 if (irq < NR_IRQS_LEGACY)
1584 disable_8259A_irq(irq); 1584 disable_8259A_irq(irq);
1585 1585
1586 ioapic_write_entry(apic, pin, entry); 1586 ioapic_write_entry(apic_id, pin, entry);
1587} 1587}
1588 1588
1589static void __init setup_IO_APIC_irqs(void) 1589static void __init setup_IO_APIC_irqs(void)
1590{ 1590{
1591 int apic, pin, idx, irq; 1591 int apic_id, pin, idx, irq;
1592 int notcon = 0; 1592 int notcon = 0;
1593 struct irq_desc *desc; 1593 struct irq_desc *desc;
1594 struct irq_cfg *cfg; 1594 struct irq_cfg *cfg;
@@ -1596,19 +1596,19 @@ static void __init setup_IO_APIC_irqs(void)
1596 1596
1597 apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n"); 1597 apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n");
1598 1598
1599 for (apic = 0; apic < nr_ioapics; apic++) { 1599 for (apic_id = 0; apic_id < nr_ioapics; apic_id++) {
1600 for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { 1600 for (pin = 0; pin < nr_ioapic_registers[apic_id]; pin++) {
1601 1601
1602 idx = find_irq_entry(apic, pin, mp_INT); 1602 idx = find_irq_entry(apic_id, pin, mp_INT);
1603 if (idx == -1) { 1603 if (idx == -1) {
1604 if (!notcon) { 1604 if (!notcon) {
1605 notcon = 1; 1605 notcon = 1;
1606 apic_printk(APIC_VERBOSE, 1606 apic_printk(APIC_VERBOSE,
1607 KERN_DEBUG " %d-%d", 1607 KERN_DEBUG " %d-%d",
1608 mp_ioapics[apic].apicid, pin); 1608 mp_ioapics[apic_id].apicid, pin);
1609 } else 1609 } else
1610 apic_printk(APIC_VERBOSE, " %d-%d", 1610 apic_printk(APIC_VERBOSE, " %d-%d",
1611 mp_ioapics[apic].apicid, pin); 1611 mp_ioapics[apic_id].apicid, pin);
1612 continue; 1612 continue;
1613 } 1613 }
1614 if (notcon) { 1614 if (notcon) {
@@ -1617,9 +1617,9 @@ static void __init setup_IO_APIC_irqs(void)
1617 notcon = 0; 1617 notcon = 0;
1618 } 1618 }
1619 1619
1620 irq = pin_2_irq(idx, apic, pin); 1620 irq = pin_2_irq(idx, apic_id, pin);
1621#ifdef CONFIG_X86_32 1621#ifdef CONFIG_X86_32
1622 if (multi_timer_check(apic, irq)) 1622 if (multi_timer_check(apic_id, irq))
1623 continue; 1623 continue;
1624#endif 1624#endif
1625 desc = irq_to_desc_alloc_cpu(irq, cpu); 1625 desc = irq_to_desc_alloc_cpu(irq, cpu);
@@ -1628,9 +1628,9 @@ static void __init setup_IO_APIC_irqs(void)
1628 continue; 1628 continue;
1629 } 1629 }
1630 cfg = desc->chip_data; 1630 cfg = desc->chip_data;
1631 add_pin_to_irq_cpu(cfg, cpu, apic, pin); 1631 add_pin_to_irq_cpu(cfg, cpu, apic_id, pin);
1632 1632
1633 setup_IO_APIC_irq(apic, pin, irq, desc, 1633 setup_IO_APIC_irq(apic_id, pin, irq, desc,
1634 irq_trigger(idx), irq_polarity(idx)); 1634 irq_trigger(idx), irq_polarity(idx));
1635 } 1635 }
1636 } 1636 }
@@ -1643,7 +1643,7 @@ static void __init setup_IO_APIC_irqs(void)
1643/* 1643/*
1644 * Set up the timer pin, possibly with the 8259A-master behind. 1644 * Set up the timer pin, possibly with the 8259A-master behind.
1645 */ 1645 */
1646static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin, 1646static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,
1647 int vector) 1647 int vector)
1648{ 1648{
1649 struct IO_APIC_route_entry entry; 1649 struct IO_APIC_route_entry entry;
@@ -1676,7 +1676,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin,
1676 /* 1676 /*
1677 * Add it to the IO-APIC irq-routing table: 1677 * Add it to the IO-APIC irq-routing table:
1678 */ 1678 */
1679 ioapic_write_entry(apic, pin, entry); 1679 ioapic_write_entry(apic_id, pin, entry);
1680} 1680}
1681 1681
1682 1682
@@ -2089,7 +2089,7 @@ static void __init setup_ioapic_ids_from_mpc(void)
2089{ 2089{
2090 union IO_APIC_reg_00 reg_00; 2090 union IO_APIC_reg_00 reg_00;
2091 physid_mask_t phys_id_present_map; 2091 physid_mask_t phys_id_present_map;
2092 int apic; 2092 int apic_id;
2093 int i; 2093 int i;
2094 unsigned char old_id; 2094 unsigned char old_id;
2095 unsigned long flags; 2095 unsigned long flags;
@@ -2113,21 +2113,21 @@ static void __init setup_ioapic_ids_from_mpc(void)
2113 /* 2113 /*
2114 * Set the IOAPIC ID to the value stored in the MPC table. 2114 * Set the IOAPIC ID to the value stored in the MPC table.
2115 */ 2115 */
2116 for (apic = 0; apic < nr_ioapics; apic++) { 2116 for (apic_id = 0; apic_id < nr_ioapics; apic_id++) {
2117 2117
2118 /* Read the register 0 value */ 2118 /* Read the register 0 value */
2119 spin_lock_irqsave(&ioapic_lock, flags); 2119 spin_lock_irqsave(&ioapic_lock, flags);
2120 reg_00.raw = io_apic_read(apic, 0); 2120 reg_00.raw = io_apic_read(apic_id, 0);
2121 spin_unlock_irqrestore(&ioapic_lock, flags); 2121 spin_unlock_irqrestore(&ioapic_lock, flags);
2122 2122
2123 old_id = mp_ioapics[apic].apicid; 2123 old_id = mp_ioapics[apic_id].apicid;
2124 2124
2125 if (mp_ioapics[apic].apicid >= get_physical_broadcast()) { 2125 if (mp_ioapics[apic_id].apicid >= get_physical_broadcast()) {
2126 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n", 2126 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n",
2127 apic, mp_ioapics[apic].apicid); 2127 apic_id, mp_ioapics[apic_id].apicid);
2128 printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", 2128 printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
2129 reg_00.bits.ID); 2129 reg_00.bits.ID);
2130 mp_ioapics[apic].apicid = reg_00.bits.ID; 2130 mp_ioapics[apic_id].apicid = reg_00.bits.ID;
2131 } 2131 }
2132 2132
2133 /* 2133 /*
@@ -2136,9 +2136,9 @@ static void __init setup_ioapic_ids_from_mpc(void)
2136 * 'stuck on smp_invalidate_needed IPI wait' messages. 2136 * 'stuck on smp_invalidate_needed IPI wait' messages.
2137 */ 2137 */
2138 if (check_apicid_used(phys_id_present_map, 2138 if (check_apicid_used(phys_id_present_map,
2139 mp_ioapics[apic].apicid)) { 2139 mp_ioapics[apic_id].apicid)) {
2140 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", 2140 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
2141 apic, mp_ioapics[apic].apicid); 2141 apic_id, mp_ioapics[apic_id].apicid);
2142 for (i = 0; i < get_physical_broadcast(); i++) 2142 for (i = 0; i < get_physical_broadcast(); i++)
2143 if (!physid_isset(i, phys_id_present_map)) 2143 if (!physid_isset(i, phys_id_present_map))
2144 break; 2144 break;
@@ -2147,13 +2147,13 @@ static void __init setup_ioapic_ids_from_mpc(void)
2147 printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", 2147 printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
2148 i); 2148 i);
2149 physid_set(i, phys_id_present_map); 2149 physid_set(i, phys_id_present_map);
2150 mp_ioapics[apic].apicid = i; 2150 mp_ioapics[apic_id].apicid = i;
2151 } else { 2151 } else {
2152 physid_mask_t tmp; 2152 physid_mask_t tmp;
2153 tmp = apicid_to_cpu_present(mp_ioapics[apic].apicid); 2153 tmp = apicid_to_cpu_present(mp_ioapics[apic_id].apicid);
2154 apic_printk(APIC_VERBOSE, "Setting %d in the " 2154 apic_printk(APIC_VERBOSE, "Setting %d in the "
2155 "phys_id_present_map\n", 2155 "phys_id_present_map\n",
2156 mp_ioapics[apic].apicid); 2156 mp_ioapics[apic_id].apicid);
2157 physids_or(phys_id_present_map, phys_id_present_map, tmp); 2157 physids_or(phys_id_present_map, phys_id_present_map, tmp);
2158 } 2158 }
2159 2159
@@ -2162,11 +2162,11 @@ static void __init setup_ioapic_ids_from_mpc(void)
2162 * We need to adjust the IRQ routing table 2162 * We need to adjust the IRQ routing table
2163 * if the ID changed. 2163 * if the ID changed.
2164 */ 2164 */
2165 if (old_id != mp_ioapics[apic].apicid) 2165 if (old_id != mp_ioapics[apic_id].apicid)
2166 for (i = 0; i < mp_irq_entries; i++) 2166 for (i = 0; i < mp_irq_entries; i++)
2167 if (mp_irqs[i].dstapic == old_id) 2167 if (mp_irqs[i].dstapic == old_id)
2168 mp_irqs[i].dstapic 2168 mp_irqs[i].dstapic
2169 = mp_ioapics[apic].apicid; 2169 = mp_ioapics[apic_id].apicid;
2170 2170
2171 /* 2171 /*
2172 * Read the right value from the MPC table and 2172 * Read the right value from the MPC table and
@@ -2174,20 +2174,20 @@ static void __init setup_ioapic_ids_from_mpc(void)
2174 */ 2174 */
2175 apic_printk(APIC_VERBOSE, KERN_INFO 2175 apic_printk(APIC_VERBOSE, KERN_INFO
2176 "...changing IO-APIC physical APIC ID to %d ...", 2176 "...changing IO-APIC physical APIC ID to %d ...",
2177 mp_ioapics[apic].apicid); 2177 mp_ioapics[apic_id].apicid);
2178 2178
2179 reg_00.bits.ID = mp_ioapics[apic].apicid; 2179 reg_00.bits.ID = mp_ioapics[apic_id].apicid;
2180 spin_lock_irqsave(&ioapic_lock, flags); 2180 spin_lock_irqsave(&ioapic_lock, flags);
2181 io_apic_write(apic, 0, reg_00.raw); 2181 io_apic_write(apic_id, 0, reg_00.raw);
2182 spin_unlock_irqrestore(&ioapic_lock, flags); 2182 spin_unlock_irqrestore(&ioapic_lock, flags);
2183 2183
2184 /* 2184 /*
2185 * Sanity check 2185 * Sanity check
2186 */ 2186 */
2187 spin_lock_irqsave(&ioapic_lock, flags); 2187 spin_lock_irqsave(&ioapic_lock, flags);
2188 reg_00.raw = io_apic_read(apic, 0); 2188 reg_00.raw = io_apic_read(apic_id, 0);
2189 spin_unlock_irqrestore(&ioapic_lock, flags); 2189 spin_unlock_irqrestore(&ioapic_lock, flags);
2190 if (reg_00.bits.ID != mp_ioapics[apic].apicid) 2190 if (reg_00.bits.ID != mp_ioapics[apic_id].apicid)
2191 printk("could not set ID!\n"); 2191 printk("could not set ID!\n");
2192 else 2192 else
2193 apic_printk(APIC_VERBOSE, " ok.\n"); 2193 apic_printk(APIC_VERBOSE, " ok.\n");