aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
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
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')
-rw-r--r--arch/x86/kernel/es7000_32.c6
-rw-r--r--arch/x86/kernel/genapic_64.c16
-rw-r--r--arch/x86/kernel/io_apic.c80
-rw-r--r--arch/x86/kernel/numaq_32.c2
-rw-r--r--arch/x86/kernel/setup.c2
5 files changed, 53 insertions, 53 deletions
diff --git a/arch/x86/kernel/es7000_32.c b/arch/x86/kernel/es7000_32.c
index 53699c931ad4..20a2a43c2a9c 100644
--- a/arch/x86/kernel/es7000_32.c
+++ b/arch/x86/kernel/es7000_32.c
@@ -188,14 +188,14 @@ static void noop_wait_for_deassert(atomic_t *deassert_not_used)
188 188
189static int __init es7000_update_genapic(void) 189static int __init es7000_update_genapic(void)
190{ 190{
191 genapic->wakeup_cpu = wakeup_secondary_cpu_via_mip; 191 apic->wakeup_cpu = wakeup_secondary_cpu_via_mip;
192 192
193 /* MPENTIUMIII */ 193 /* MPENTIUMIII */
194 if (boot_cpu_data.x86 == 6 && 194 if (boot_cpu_data.x86 == 6 &&
195 (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11)) { 195 (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11)) {
196 es7000_update_genapic_to_cluster(); 196 es7000_update_genapic_to_cluster();
197 genapic->wait_for_init_deassert = noop_wait_for_deassert; 197 apic->wait_for_init_deassert = noop_wait_for_deassert;
198 genapic->wakeup_cpu = wakeup_secondary_cpu_via_mip; 198 apic->wakeup_cpu = wakeup_secondary_cpu_via_mip;
199 } 199 }
200 200
201 return 0; 201 return 0;
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c
index e656c2721154..2b986389a24f 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/genapic_64.c
@@ -29,7 +29,7 @@ extern struct genapic apic_x2xpic_uv_x;
29extern struct genapic apic_x2apic_phys; 29extern struct genapic apic_x2apic_phys;
30extern struct genapic apic_x2apic_cluster; 30extern struct genapic apic_x2apic_cluster;
31 31
32struct genapic __read_mostly *genapic = &apic_flat; 32struct genapic __read_mostly *apic = &apic_flat;
33 33
34static struct genapic *apic_probe[] __initdata = { 34static struct genapic *apic_probe[] __initdata = {
35#ifdef CONFIG_X86_UV 35#ifdef CONFIG_X86_UV
@@ -46,15 +46,15 @@ static struct genapic *apic_probe[] __initdata = {
46 */ 46 */
47void __init setup_apic_routing(void) 47void __init setup_apic_routing(void)
48{ 48{
49 if (genapic == &apic_x2apic_phys || genapic == &apic_x2apic_cluster) { 49 if (apic == &apic_x2apic_phys || apic == &apic_x2apic_cluster) {
50 if (!intr_remapping_enabled) 50 if (!intr_remapping_enabled)
51 genapic = &apic_flat; 51 apic = &apic_flat;
52 } 52 }
53 53
54 if (genapic == &apic_flat) { 54 if (apic == &apic_flat) {
55 if (max_physical_apicid >= 8) 55 if (max_physical_apicid >= 8)
56 genapic = &apic_physflat; 56 apic = &apic_physflat;
57 printk(KERN_INFO "Setting APIC routing to %s\n", genapic->name); 57 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
58 } 58 }
59 59
60 if (x86_quirks->update_genapic) 60 if (x86_quirks->update_genapic)
@@ -74,9 +74,9 @@ int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
74 74
75 for (i = 0; apic_probe[i]; ++i) { 75 for (i = 0; apic_probe[i]; ++i) {
76 if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) { 76 if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) {
77 genapic = apic_probe[i]; 77 apic = apic_probe[i];
78 printk(KERN_INFO "Setting APIC routing to %s.\n", 78 printk(KERN_INFO "Setting APIC routing to %s.\n",
79 genapic->name); 79 apic->name);
80 return 1; 80 return 1;
81 } 81 }
82 } 82 }
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");
diff --git a/arch/x86/kernel/numaq_32.c b/arch/x86/kernel/numaq_32.c
index f2191d4f2717..3928280278f0 100644
--- a/arch/x86/kernel/numaq_32.c
+++ b/arch/x86/kernel/numaq_32.c
@@ -236,7 +236,7 @@ static int __init numaq_setup_ioapic_ids(void)
236 236
237static int __init numaq_update_genapic(void) 237static int __init numaq_update_genapic(void)
238{ 238{
239 genapic->wakeup_cpu = wakeup_secondary_cpu_via_nmi; 239 apic->wakeup_cpu = wakeup_secondary_cpu_via_nmi;
240 240
241 return 0; 241 return 0;
242} 242}
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index f41c4486c270..a58e9f5e6030 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -590,7 +590,7 @@ static int __init default_update_genapic(void)
590{ 590{
591#ifdef CONFIG_X86_SMP 591#ifdef CONFIG_X86_SMP
592# if defined(CONFIG_X86_GENERICARCH) || defined(CONFIG_X86_64) 592# if defined(CONFIG_X86_GENERICARCH) || defined(CONFIG_X86_64)
593 genapic->wakeup_cpu = wakeup_secondary_cpu_via_init; 593 apic->wakeup_cpu = wakeup_secondary_cpu_via_init;
594# endif 594# endif
595#endif 595#endif
596 596