diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2008-05-14 11:03:10 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-25 04:55:13 -0400 |
commit | ec2cd0a22e2715f776a934e01c4f8ea098324fe1 (patch) | |
tree | a0270f2fd50ef243c867cfb51d89ecf9bdae58d3 /arch | |
parent | 5f8951487ddbacbc949e9ffae574f94791f9b4dd (diff) |
x86: make struct config_ioapic not MPspec specific
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 28 | ||||
-rw-r--r-- | arch/x86/kernel/apic_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic_32.c | 52 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic_64.c | 26 | ||||
-rw-r--r-- | arch/x86/kernel/mpparse.c | 8 |
5 files changed, 60 insertions, 56 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index f75c2030f4b5..a26dd91faf0f 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -887,8 +887,8 @@ static u8 __init uniq_ioapic_id(u8 id) | |||
887 | DECLARE_BITMAP(used, 256); | 887 | DECLARE_BITMAP(used, 256); |
888 | bitmap_zero(used, 256); | 888 | bitmap_zero(used, 256); |
889 | for (i = 0; i < nr_ioapics; i++) { | 889 | for (i = 0; i < nr_ioapics; i++) { |
890 | struct mpc_config_ioapic *ia = &mp_ioapics[i]; | 890 | struct mp_config_ioapic *ia = &mp_ioapics[i]; |
891 | __set_bit(ia->mpc_apicid, used); | 891 | __set_bit(ia->mp_apicid, used); |
892 | } | 892 | } |
893 | if (!test_bit(id, used)) | 893 | if (!test_bit(id, used)) |
894 | return id; | 894 | return id; |
@@ -920,29 +920,29 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) | |||
920 | 920 | ||
921 | idx = nr_ioapics; | 921 | idx = nr_ioapics; |
922 | 922 | ||
923 | mp_ioapics[idx].mpc_type = MP_IOAPIC; | 923 | mp_ioapics[idx].mp_type = MP_IOAPIC; |
924 | mp_ioapics[idx].mpc_flags = MPC_APIC_USABLE; | 924 | mp_ioapics[idx].mp_flags = MPC_APIC_USABLE; |
925 | mp_ioapics[idx].mpc_apicaddr = address; | 925 | mp_ioapics[idx].mp_apicaddr = address; |
926 | 926 | ||
927 | set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); | 927 | set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); |
928 | mp_ioapics[idx].mpc_apicid = uniq_ioapic_id(id); | 928 | mp_ioapics[idx].mp_apicid = uniq_ioapic_id(id); |
929 | #ifdef CONFIG_X86_32 | 929 | #ifdef CONFIG_X86_32 |
930 | mp_ioapics[idx].mpc_apicver = io_apic_get_version(idx); | 930 | mp_ioapics[idx].mp_apicver = io_apic_get_version(idx); |
931 | #else | 931 | #else |
932 | mp_ioapics[idx].mpc_apicver = 0; | 932 | mp_ioapics[idx].mp_apicver = 0; |
933 | #endif | 933 | #endif |
934 | /* | 934 | /* |
935 | * Build basic GSI lookup table to facilitate gsi->io_apic lookups | 935 | * Build basic GSI lookup table to facilitate gsi->io_apic lookups |
936 | * and to prevent reprogramming of IOAPIC pins (PCI GSIs). | 936 | * and to prevent reprogramming of IOAPIC pins (PCI GSIs). |
937 | */ | 937 | */ |
938 | mp_ioapic_routing[idx].apic_id = mp_ioapics[idx].mpc_apicid; | 938 | mp_ioapic_routing[idx].apic_id = mp_ioapics[idx].mp_apicid; |
939 | mp_ioapic_routing[idx].gsi_base = gsi_base; | 939 | mp_ioapic_routing[idx].gsi_base = gsi_base; |
940 | mp_ioapic_routing[idx].gsi_end = gsi_base + | 940 | mp_ioapic_routing[idx].gsi_end = gsi_base + |
941 | io_apic_get_redir_entries(idx); | 941 | io_apic_get_redir_entries(idx); |
942 | 942 | ||
943 | printk(KERN_INFO "IOAPIC[%d]: apic_id %d, version %d, address 0x%x, " | 943 | printk(KERN_INFO "IOAPIC[%d]: apic_id %d, version %d, address 0x%lx, " |
944 | "GSI %d-%d\n", idx, mp_ioapics[idx].mpc_apicid, | 944 | "GSI %d-%d\n", idx, mp_ioapics[idx].mp_apicid, |
945 | mp_ioapics[idx].mpc_apicver, mp_ioapics[idx].mpc_apicaddr, | 945 | mp_ioapics[idx].mp_apicver, mp_ioapics[idx].mp_apicaddr, |
946 | mp_ioapic_routing[idx].gsi_base, mp_ioapic_routing[idx].gsi_end); | 946 | mp_ioapic_routing[idx].gsi_base, mp_ioapic_routing[idx].gsi_end); |
947 | 947 | ||
948 | nr_ioapics++; | 948 | nr_ioapics++; |
@@ -975,7 +975,7 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi) | |||
975 | mp_irqs[mp_irq_entries].mpc_srcbus = MP_ISA_BUS; | 975 | mp_irqs[mp_irq_entries].mpc_srcbus = MP_ISA_BUS; |
976 | mp_irqs[mp_irq_entries].mpc_srcbusirq = bus_irq; /* IRQ */ | 976 | mp_irqs[mp_irq_entries].mpc_srcbusirq = bus_irq; /* IRQ */ |
977 | mp_irqs[mp_irq_entries].mpc_dstapic = | 977 | mp_irqs[mp_irq_entries].mpc_dstapic = |
978 | mp_ioapics[ioapic].mpc_apicid; /* APIC ID */ | 978 | mp_ioapics[ioapic].mp_apicid; /* APIC ID */ |
979 | mp_irqs[mp_irq_entries].mpc_dstirq = pin; /* INTIN# */ | 979 | mp_irqs[mp_irq_entries].mpc_dstirq = pin; /* INTIN# */ |
980 | 980 | ||
981 | if (++mp_irq_entries == MAX_IRQ_SOURCES) | 981 | if (++mp_irq_entries == MAX_IRQ_SOURCES) |
@@ -1016,7 +1016,7 @@ void __init mp_config_acpi_legacy_irqs(void) | |||
1016 | mp_irqs[mp_irq_entries].mpc_irqflag = 0; /* Conforming */ | 1016 | mp_irqs[mp_irq_entries].mpc_irqflag = 0; /* Conforming */ |
1017 | mp_irqs[mp_irq_entries].mpc_srcbus = MP_ISA_BUS; | 1017 | mp_irqs[mp_irq_entries].mpc_srcbus = MP_ISA_BUS; |
1018 | #ifdef CONFIG_X86_IO_APIC | 1018 | #ifdef CONFIG_X86_IO_APIC |
1019 | mp_irqs[mp_irq_entries].mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; | 1019 | mp_irqs[mp_irq_entries].mpc_dstapic = mp_ioapics[ioapic].mp_apicid; |
1020 | #endif | 1020 | #endif |
1021 | /* | 1021 | /* |
1022 | * Use the default configuration for the IRQs 0-15. Unless | 1022 | * Use the default configuration for the IRQs 0-15. Unless |
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 4b99b1bdeb6c..fa1be1d62916 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -1202,7 +1202,7 @@ void __init init_apic_mappings(void) | |||
1202 | 1202 | ||
1203 | for (i = 0; i < nr_ioapics; i++) { | 1203 | for (i = 0; i < nr_ioapics; i++) { |
1204 | if (smp_found_config) { | 1204 | if (smp_found_config) { |
1205 | ioapic_phys = mp_ioapics[i].mpc_apicaddr; | 1205 | ioapic_phys = mp_ioapics[i].mp_apicaddr; |
1206 | if (!ioapic_phys) { | 1206 | if (!ioapic_phys) { |
1207 | printk(KERN_ERR | 1207 | printk(KERN_ERR |
1208 | "WARNING: bogus zero IO-APIC " | 1208 | "WARNING: bogus zero IO-APIC " |
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c index a40d54fc1fdd..5af1b717236c 100644 --- a/arch/x86/kernel/io_apic_32.c +++ b/arch/x86/kernel/io_apic_32.c | |||
@@ -72,7 +72,7 @@ int sis_apic_bug = -1; | |||
72 | int nr_ioapic_registers[MAX_IO_APICS]; | 72 | int nr_ioapic_registers[MAX_IO_APICS]; |
73 | 73 | ||
74 | /* I/O APIC entries */ | 74 | /* I/O APIC entries */ |
75 | struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS]; | 75 | struct mp_config_ioapic mp_ioapics[MAX_IO_APICS]; |
76 | int nr_ioapics; | 76 | int nr_ioapics; |
77 | 77 | ||
78 | /* MP IRQ source entries */ | 78 | /* MP IRQ source entries */ |
@@ -110,7 +110,7 @@ struct io_apic { | |||
110 | static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx) | 110 | static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx) |
111 | { | 111 | { |
112 | return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx) | 112 | return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx) |
113 | + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK); | 113 | + (mp_ioapics[idx].mp_apicaddr & ~PAGE_MASK); |
114 | } | 114 | } |
115 | 115 | ||
116 | static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) | 116 | 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) | |||
802 | 802 | ||
803 | for (i = 0; i < mp_irq_entries; i++) | 803 | for (i = 0; i < mp_irq_entries; i++) |
804 | if (mp_irqs[i].mpc_irqtype == type && | 804 | if (mp_irqs[i].mpc_irqtype == type && |
805 | (mp_irqs[i].mpc_dstapic == mp_ioapics[apic].mpc_apicid || | 805 | (mp_irqs[i].mpc_dstapic == mp_ioapics[apic].mp_apicid || |
806 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) && | 806 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) && |
807 | mp_irqs[i].mpc_dstirq == pin) | 807 | mp_irqs[i].mpc_dstirq == pin) |
808 | return i; | 808 | return i; |
@@ -844,7 +844,7 @@ static int __init find_isa_irq_apic(int irq, int type) | |||
844 | if (i < mp_irq_entries) { | 844 | if (i < mp_irq_entries) { |
845 | int apic; | 845 | int apic; |
846 | for(apic = 0; apic < nr_ioapics; apic++) { | 846 | for(apic = 0; apic < nr_ioapics; apic++) { |
847 | if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic) | 847 | if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mpc_dstapic) |
848 | return apic; | 848 | return apic; |
849 | } | 849 | } |
850 | } | 850 | } |
@@ -872,7 +872,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin) | |||
872 | int lbus = mp_irqs[i].mpc_srcbus; | 872 | int lbus = mp_irqs[i].mpc_srcbus; |
873 | 873 | ||
874 | for (apic = 0; apic < nr_ioapics; apic++) | 874 | for (apic = 0; apic < nr_ioapics; apic++) |
875 | if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic || | 875 | if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mpc_dstapic || |
876 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) | 876 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) |
877 | break; | 877 | break; |
878 | 878 | ||
@@ -1250,12 +1250,12 @@ static void __init setup_IO_APIC_irqs(void) | |||
1250 | if (first_notcon) { | 1250 | if (first_notcon) { |
1251 | apic_printk(APIC_VERBOSE, KERN_DEBUG | 1251 | apic_printk(APIC_VERBOSE, KERN_DEBUG |
1252 | " IO-APIC (apicid-pin) %d-%d", | 1252 | " IO-APIC (apicid-pin) %d-%d", |
1253 | mp_ioapics[apic].mpc_apicid, | 1253 | mp_ioapics[apic].mp_apicid, |
1254 | pin); | 1254 | pin); |
1255 | first_notcon = 0; | 1255 | first_notcon = 0; |
1256 | } else | 1256 | } else |
1257 | apic_printk(APIC_VERBOSE, ", %d-%d", | 1257 | apic_printk(APIC_VERBOSE, ", %d-%d", |
1258 | mp_ioapics[apic].mpc_apicid, pin); | 1258 | mp_ioapics[apic].mp_apicid, pin); |
1259 | continue; | 1259 | continue; |
1260 | } | 1260 | } |
1261 | 1261 | ||
@@ -1357,7 +1357,7 @@ void __init print_IO_APIC(void) | |||
1357 | printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); | 1357 | printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); |
1358 | for (i = 0; i < nr_ioapics; i++) | 1358 | for (i = 0; i < nr_ioapics; i++) |
1359 | printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", | 1359 | printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", |
1360 | mp_ioapics[i].mpc_apicid, nr_ioapic_registers[i]); | 1360 | mp_ioapics[i].mp_apicid, nr_ioapic_registers[i]); |
1361 | 1361 | ||
1362 | /* | 1362 | /* |
1363 | * We are a bit conservative about what we expect. We have to | 1363 | * We are a bit conservative about what we expect. We have to |
@@ -1376,7 +1376,7 @@ void __init print_IO_APIC(void) | |||
1376 | reg_03.raw = io_apic_read(apic, 3); | 1376 | reg_03.raw = io_apic_read(apic, 3); |
1377 | spin_unlock_irqrestore(&ioapic_lock, flags); | 1377 | spin_unlock_irqrestore(&ioapic_lock, flags); |
1378 | 1378 | ||
1379 | printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].mpc_apicid); | 1379 | printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].mp_apicid); |
1380 | printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw); | 1380 | printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw); |
1381 | printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID); | 1381 | printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID); |
1382 | printk(KERN_DEBUG "....... : Delivery Type: %X\n", reg_00.bits.delivery_type); | 1382 | 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) | |||
1749 | reg_00.raw = io_apic_read(apic, 0); | 1749 | reg_00.raw = io_apic_read(apic, 0); |
1750 | spin_unlock_irqrestore(&ioapic_lock, flags); | 1750 | spin_unlock_irqrestore(&ioapic_lock, flags); |
1751 | 1751 | ||
1752 | old_id = mp_ioapics[apic].mpc_apicid; | 1752 | old_id = mp_ioapics[apic].mp_apicid; |
1753 | 1753 | ||
1754 | if (mp_ioapics[apic].mpc_apicid >= get_physical_broadcast()) { | 1754 | if (mp_ioapics[apic].mp_apicid >= get_physical_broadcast()) { |
1755 | printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n", | 1755 | printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n", |
1756 | apic, mp_ioapics[apic].mpc_apicid); | 1756 | apic, mp_ioapics[apic].mp_apicid); |
1757 | printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", | 1757 | printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", |
1758 | reg_00.bits.ID); | 1758 | reg_00.bits.ID); |
1759 | mp_ioapics[apic].mpc_apicid = reg_00.bits.ID; | 1759 | mp_ioapics[apic].mp_apicid = reg_00.bits.ID; |
1760 | } | 1760 | } |
1761 | 1761 | ||
1762 | /* | 1762 | /* |
@@ -1765,9 +1765,9 @@ static void __init setup_ioapic_ids_from_mpc(void) | |||
1765 | * 'stuck on smp_invalidate_needed IPI wait' messages. | 1765 | * 'stuck on smp_invalidate_needed IPI wait' messages. |
1766 | */ | 1766 | */ |
1767 | if (check_apicid_used(phys_id_present_map, | 1767 | if (check_apicid_used(phys_id_present_map, |
1768 | mp_ioapics[apic].mpc_apicid)) { | 1768 | mp_ioapics[apic].mp_apicid)) { |
1769 | printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", | 1769 | printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", |
1770 | apic, mp_ioapics[apic].mpc_apicid); | 1770 | apic, mp_ioapics[apic].mp_apicid); |
1771 | for (i = 0; i < get_physical_broadcast(); i++) | 1771 | for (i = 0; i < get_physical_broadcast(); i++) |
1772 | if (!physid_isset(i, phys_id_present_map)) | 1772 | if (!physid_isset(i, phys_id_present_map)) |
1773 | break; | 1773 | break; |
@@ -1776,13 +1776,13 @@ static void __init setup_ioapic_ids_from_mpc(void) | |||
1776 | printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", | 1776 | printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", |
1777 | i); | 1777 | i); |
1778 | physid_set(i, phys_id_present_map); | 1778 | physid_set(i, phys_id_present_map); |
1779 | mp_ioapics[apic].mpc_apicid = i; | 1779 | mp_ioapics[apic].mp_apicid = i; |
1780 | } else { | 1780 | } else { |
1781 | physid_mask_t tmp; | 1781 | physid_mask_t tmp; |
1782 | tmp = apicid_to_cpu_present(mp_ioapics[apic].mpc_apicid); | 1782 | tmp = apicid_to_cpu_present(mp_ioapics[apic].mp_apicid); |
1783 | apic_printk(APIC_VERBOSE, "Setting %d in the " | 1783 | apic_printk(APIC_VERBOSE, "Setting %d in the " |
1784 | "phys_id_present_map\n", | 1784 | "phys_id_present_map\n", |
1785 | mp_ioapics[apic].mpc_apicid); | 1785 | mp_ioapics[apic].mp_apicid); |
1786 | physids_or(phys_id_present_map, phys_id_present_map, tmp); | 1786 | physids_or(phys_id_present_map, phys_id_present_map, tmp); |
1787 | } | 1787 | } |
1788 | 1788 | ||
@@ -1791,11 +1791,11 @@ static void __init setup_ioapic_ids_from_mpc(void) | |||
1791 | * We need to adjust the IRQ routing table | 1791 | * We need to adjust the IRQ routing table |
1792 | * if the ID changed. | 1792 | * if the ID changed. |
1793 | */ | 1793 | */ |
1794 | if (old_id != mp_ioapics[apic].mpc_apicid) | 1794 | if (old_id != mp_ioapics[apic].mp_apicid) |
1795 | for (i = 0; i < mp_irq_entries; i++) | 1795 | for (i = 0; i < mp_irq_entries; i++) |
1796 | if (mp_irqs[i].mpc_dstapic == old_id) | 1796 | if (mp_irqs[i].mpc_dstapic == old_id) |
1797 | mp_irqs[i].mpc_dstapic | 1797 | mp_irqs[i].mpc_dstapic |
1798 | = mp_ioapics[apic].mpc_apicid; | 1798 | = mp_ioapics[apic].mp_apicid; |
1799 | 1799 | ||
1800 | /* | 1800 | /* |
1801 | * Read the right value from the MPC table and | 1801 | * Read the right value from the MPC table and |
@@ -1803,9 +1803,9 @@ static void __init setup_ioapic_ids_from_mpc(void) | |||
1803 | */ | 1803 | */ |
1804 | apic_printk(APIC_VERBOSE, KERN_INFO | 1804 | apic_printk(APIC_VERBOSE, KERN_INFO |
1805 | "...changing IO-APIC physical APIC ID to %d ...", | 1805 | "...changing IO-APIC physical APIC ID to %d ...", |
1806 | mp_ioapics[apic].mpc_apicid); | 1806 | mp_ioapics[apic].mp_apicid); |
1807 | 1807 | ||
1808 | reg_00.bits.ID = mp_ioapics[apic].mpc_apicid; | 1808 | reg_00.bits.ID = mp_ioapics[apic].mp_apicid; |
1809 | spin_lock_irqsave(&ioapic_lock, flags); | 1809 | spin_lock_irqsave(&ioapic_lock, flags); |
1810 | io_apic_write(apic, 0, reg_00.raw); | 1810 | io_apic_write(apic, 0, reg_00.raw); |
1811 | spin_unlock_irqrestore(&ioapic_lock, flags); | 1811 | spin_unlock_irqrestore(&ioapic_lock, flags); |
@@ -1816,7 +1816,7 @@ static void __init setup_ioapic_ids_from_mpc(void) | |||
1816 | spin_lock_irqsave(&ioapic_lock, flags); | 1816 | spin_lock_irqsave(&ioapic_lock, flags); |
1817 | reg_00.raw = io_apic_read(apic, 0); | 1817 | reg_00.raw = io_apic_read(apic, 0); |
1818 | spin_unlock_irqrestore(&ioapic_lock, flags); | 1818 | spin_unlock_irqrestore(&ioapic_lock, flags); |
1819 | if (reg_00.bits.ID != mp_ioapics[apic].mpc_apicid) | 1819 | if (reg_00.bits.ID != mp_ioapics[apic].mp_apicid) |
1820 | printk("could not set ID!\n"); | 1820 | printk("could not set ID!\n"); |
1821 | else | 1821 | else |
1822 | apic_printk(APIC_VERBOSE, " ok.\n"); | 1822 | apic_printk(APIC_VERBOSE, " ok.\n"); |
@@ -2355,8 +2355,8 @@ static int ioapic_resume(struct sys_device *dev) | |||
2355 | 2355 | ||
2356 | spin_lock_irqsave(&ioapic_lock, flags); | 2356 | spin_lock_irqsave(&ioapic_lock, flags); |
2357 | reg_00.raw = io_apic_read(dev->id, 0); | 2357 | reg_00.raw = io_apic_read(dev->id, 0); |
2358 | if (reg_00.bits.ID != mp_ioapics[dev->id].mpc_apicid) { | 2358 | if (reg_00.bits.ID != mp_ioapics[dev->id].mp_apicid) { |
2359 | reg_00.bits.ID = mp_ioapics[dev->id].mpc_apicid; | 2359 | reg_00.bits.ID = mp_ioapics[dev->id].mp_apicid; |
2360 | io_apic_write(dev->id, 0, reg_00.raw); | 2360 | io_apic_write(dev->id, 0, reg_00.raw); |
2361 | } | 2361 | } |
2362 | spin_unlock_irqrestore(&ioapic_lock, flags); | 2362 | 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 | |||
2789 | 2789 | ||
2790 | apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry " | 2790 | apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry " |
2791 | "(%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i)\n", ioapic, | 2791 | "(%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i)\n", ioapic, |
2792 | mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq, | 2792 | mp_ioapics[ioapic].mp_apicid, pin, entry.vector, irq, |
2793 | edge_level, active_high_low); | 2793 | edge_level, active_high_low); |
2794 | 2794 | ||
2795 | ioapic_register_intr(irq, entry.vector, edge_level); | 2795 | ioapic_register_intr(irq, entry.vector, edge_level); |
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c index ef1a8dfcc529..4555ad8c2070 100644 --- a/arch/x86/kernel/io_apic_64.c +++ b/arch/x86/kernel/io_apic_64.c | |||
@@ -104,7 +104,7 @@ DEFINE_SPINLOCK(vector_lock); | |||
104 | int nr_ioapic_registers[MAX_IO_APICS]; | 104 | int nr_ioapic_registers[MAX_IO_APICS]; |
105 | 105 | ||
106 | /* I/O APIC entries */ | 106 | /* I/O APIC entries */ |
107 | struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS]; | 107 | struct mp_config_ioapic mp_ioapics[MAX_IO_APICS]; |
108 | int nr_ioapics; | 108 | int nr_ioapics; |
109 | 109 | ||
110 | /* MP IRQ source entries */ | 110 | /* MP IRQ source entries */ |
@@ -140,7 +140,7 @@ struct io_apic { | |||
140 | static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx) | 140 | static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx) |
141 | { | 141 | { |
142 | return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx) | 142 | return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx) |
143 | + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK); | 143 | + (mp_ioapics[idx].mp_apicaddr & ~PAGE_MASK); |
144 | } | 144 | } |
145 | 145 | ||
146 | static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) | 146 | static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) |
@@ -454,7 +454,7 @@ static int find_irq_entry(int apic, int pin, int type) | |||
454 | 454 | ||
455 | for (i = 0; i < mp_irq_entries; i++) | 455 | for (i = 0; i < mp_irq_entries; i++) |
456 | if (mp_irqs[i].mpc_irqtype == type && | 456 | if (mp_irqs[i].mpc_irqtype == type && |
457 | (mp_irqs[i].mpc_dstapic == mp_ioapics[apic].mpc_apicid || | 457 | (mp_irqs[i].mpc_dstapic == mp_ioapics[apic].mp_apicid || |
458 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) && | 458 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) && |
459 | mp_irqs[i].mpc_dstirq == pin) | 459 | mp_irqs[i].mpc_dstirq == pin) |
460 | return i; | 460 | return i; |
@@ -496,7 +496,7 @@ static int __init find_isa_irq_apic(int irq, int type) | |||
496 | if (i < mp_irq_entries) { | 496 | if (i < mp_irq_entries) { |
497 | int apic; | 497 | int apic; |
498 | for(apic = 0; apic < nr_ioapics; apic++) { | 498 | for(apic = 0; apic < nr_ioapics; apic++) { |
499 | if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic) | 499 | if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mpc_dstapic) |
500 | return apic; | 500 | return apic; |
501 | } | 501 | } |
502 | } | 502 | } |
@@ -524,7 +524,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin) | |||
524 | int lbus = mp_irqs[i].mpc_srcbus; | 524 | int lbus = mp_irqs[i].mpc_srcbus; |
525 | 525 | ||
526 | for (apic = 0; apic < nr_ioapics; apic++) | 526 | for (apic = 0; apic < nr_ioapics; apic++) |
527 | if (mp_ioapics[apic].mpc_apicid == mp_irqs[i].mpc_dstapic || | 527 | if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mpc_dstapic || |
528 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) | 528 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) |
529 | break; | 529 | break; |
530 | 530 | ||
@@ -846,7 +846,7 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, | |||
846 | apic_printk(APIC_VERBOSE,KERN_DEBUG | 846 | apic_printk(APIC_VERBOSE,KERN_DEBUG |
847 | "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> " | 847 | "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> " |
848 | "IRQ %d Mode:%i Active:%i)\n", | 848 | "IRQ %d Mode:%i Active:%i)\n", |
849 | apic, mp_ioapics[apic].mpc_apicid, pin, cfg->vector, | 849 | apic, mp_ioapics[apic].mp_apicid, pin, cfg->vector, |
850 | irq, trigger, polarity); | 850 | irq, trigger, polarity); |
851 | 851 | ||
852 | /* | 852 | /* |
@@ -887,10 +887,10 @@ static void __init setup_IO_APIC_irqs(void) | |||
887 | idx = find_irq_entry(apic,pin,mp_INT); | 887 | idx = find_irq_entry(apic,pin,mp_INT); |
888 | if (idx == -1) { | 888 | if (idx == -1) { |
889 | if (first_notcon) { | 889 | if (first_notcon) { |
890 | apic_printk(APIC_VERBOSE, KERN_DEBUG " IO-APIC (apicid-pin) %d-%d", mp_ioapics[apic].mpc_apicid, pin); | 890 | apic_printk(APIC_VERBOSE, KERN_DEBUG " IO-APIC (apicid-pin) %d-%d", mp_ioapics[apic].mp_apicid, pin); |
891 | first_notcon = 0; | 891 | first_notcon = 0; |
892 | } else | 892 | } else |
893 | apic_printk(APIC_VERBOSE, ", %d-%d", mp_ioapics[apic].mpc_apicid, pin); | 893 | apic_printk(APIC_VERBOSE, ", %d-%d", mp_ioapics[apic].mp_apicid, pin); |
894 | continue; | 894 | continue; |
895 | } | 895 | } |
896 | if (!first_notcon) { | 896 | if (!first_notcon) { |
@@ -965,7 +965,7 @@ void __apicdebuginit print_IO_APIC(void) | |||
965 | printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); | 965 | printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); |
966 | for (i = 0; i < nr_ioapics; i++) | 966 | for (i = 0; i < nr_ioapics; i++) |
967 | printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", | 967 | printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", |
968 | mp_ioapics[i].mpc_apicid, nr_ioapic_registers[i]); | 968 | mp_ioapics[i].mp_apicid, nr_ioapic_registers[i]); |
969 | 969 | ||
970 | /* | 970 | /* |
971 | * We are a bit conservative about what we expect. We have to | 971 | * We are a bit conservative about what we expect. We have to |
@@ -983,7 +983,7 @@ void __apicdebuginit print_IO_APIC(void) | |||
983 | spin_unlock_irqrestore(&ioapic_lock, flags); | 983 | spin_unlock_irqrestore(&ioapic_lock, flags); |
984 | 984 | ||
985 | printk("\n"); | 985 | printk("\n"); |
986 | printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].mpc_apicid); | 986 | printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].mp_apicid); |
987 | printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw); | 987 | printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw); |
988 | printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID); | 988 | printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID); |
989 | 989 | ||
@@ -1841,8 +1841,8 @@ static int ioapic_resume(struct sys_device *dev) | |||
1841 | 1841 | ||
1842 | spin_lock_irqsave(&ioapic_lock, flags); | 1842 | spin_lock_irqsave(&ioapic_lock, flags); |
1843 | reg_00.raw = io_apic_read(dev->id, 0); | 1843 | reg_00.raw = io_apic_read(dev->id, 0); |
1844 | if (reg_00.bits.ID != mp_ioapics[dev->id].mpc_apicid) { | 1844 | if (reg_00.bits.ID != mp_ioapics[dev->id].mp_apicid) { |
1845 | reg_00.bits.ID = mp_ioapics[dev->id].mpc_apicid; | 1845 | reg_00.bits.ID = mp_ioapics[dev->id].mp_apicid; |
1846 | io_apic_write(dev->id, 0, reg_00.raw); | 1846 | io_apic_write(dev->id, 0, reg_00.raw); |
1847 | } | 1847 | } |
1848 | spin_unlock_irqrestore(&ioapic_lock, flags); | 1848 | spin_unlock_irqrestore(&ioapic_lock, flags); |
@@ -2336,7 +2336,7 @@ void __init ioapic_init_mappings(void) | |||
2336 | ioapic_res = ioapic_setup_resources(); | 2336 | ioapic_res = ioapic_setup_resources(); |
2337 | for (i = 0; i < nr_ioapics; i++) { | 2337 | for (i = 0; i < nr_ioapics; i++) { |
2338 | if (smp_found_config) { | 2338 | if (smp_found_config) { |
2339 | ioapic_phys = mp_ioapics[i].mpc_apicaddr; | 2339 | ioapic_phys = mp_ioapics[i].mp_apicaddr; |
2340 | } else { | 2340 | } else { |
2341 | ioapic_phys = (unsigned long) | 2341 | ioapic_phys = (unsigned long) |
2342 | alloc_bootmem_pages(PAGE_SIZE); | 2342 | alloc_bootmem_pages(PAGE_SIZE); |
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index d05b70c329c4..9f1e5bf7f0fb 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
@@ -176,7 +176,11 @@ static void __init MP_ioapic_info(struct mpc_config_ioapic *m) | |||
176 | if (bad_ioapic(m->mpc_apicaddr)) | 176 | if (bad_ioapic(m->mpc_apicaddr)) |
177 | return; | 177 | return; |
178 | 178 | ||
179 | mp_ioapics[nr_ioapics] = *m; | 179 | mp_ioapics[nr_ioapics].mp_apicaddr = m->mpc_apicaddr; |
180 | mp_ioapics[nr_ioapics].mp_apicid = m->mpc_apicid; | ||
181 | mp_ioapics[nr_ioapics].mp_type = m->mpc_type; | ||
182 | mp_ioapics[nr_ioapics].mp_apicver = m->mpc_apicver; | ||
183 | mp_ioapics[nr_ioapics].mp_flags = m->mpc_flags; | ||
180 | nr_ioapics++; | 184 | nr_ioapics++; |
181 | } | 185 | } |
182 | 186 | ||
@@ -426,7 +430,7 @@ static void __init construct_default_ioirq_mptable(int mpc_default_type) | |||
426 | intsrc.mpc_type = MP_INTSRC; | 430 | intsrc.mpc_type = MP_INTSRC; |
427 | intsrc.mpc_irqflag = 0; /* conforming */ | 431 | intsrc.mpc_irqflag = 0; /* conforming */ |
428 | intsrc.mpc_srcbus = 0; | 432 | intsrc.mpc_srcbus = 0; |
429 | intsrc.mpc_dstapic = mp_ioapics[0].mpc_apicid; | 433 | intsrc.mpc_dstapic = mp_ioapics[0].mp_apicid; |
430 | 434 | ||
431 | intsrc.mpc_irqtype = mp_INT; | 435 | intsrc.mpc_irqtype = mp_INT; |
432 | 436 | ||