diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-06-27 04:41:56 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 07:16:04 -0400 |
commit | f3294a33e765d8308c3e17b951a13e0db9cf5f00 (patch) | |
tree | d73b3b157bd1e21b9dbbdd49bfbb64f5763accfb /arch/x86/kernel/io_apic_32.c | |
parent | ab67715c7201be2fe729888a09007b6ba5bb2326 (diff) |
x86: let setup_arch call init_apic_mappings for 32bit
instead of calling it from trap_init()
also move init ioapic mapping out of apic_32.c
so 32 bit do same as 64 bit
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/io_apic_32.c')
-rw-r--r-- | arch/x86/kernel/io_apic_32.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c index d6af301c822b..337ec3438a8f 100644 --- a/arch/x86/kernel/io_apic_32.c +++ b/arch/x86/kernel/io_apic_32.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
27 | #include <linux/sched.h> | 27 | #include <linux/sched.h> |
28 | #include <linux/bootmem.h> | ||
28 | #include <linux/mc146818rtc.h> | 29 | #include <linux/mc146818rtc.h> |
29 | #include <linux/compiler.h> | 30 | #include <linux/compiler.h> |
30 | #include <linux/acpi.h> | 31 | #include <linux/acpi.h> |
@@ -2852,3 +2853,34 @@ static int __init parse_noapic(char *arg) | |||
2852 | return 0; | 2853 | return 0; |
2853 | } | 2854 | } |
2854 | early_param("noapic", parse_noapic); | 2855 | early_param("noapic", parse_noapic); |
2856 | |||
2857 | void __init ioapic_init_mappings(void) | ||
2858 | { | ||
2859 | unsigned long ioapic_phys, idx = FIX_IO_APIC_BASE_0; | ||
2860 | int i; | ||
2861 | |||
2862 | for (i = 0; i < nr_ioapics; i++) { | ||
2863 | if (smp_found_config) { | ||
2864 | ioapic_phys = mp_ioapics[i].mp_apicaddr; | ||
2865 | if (!ioapic_phys) { | ||
2866 | printk(KERN_ERR | ||
2867 | "WARNING: bogus zero IO-APIC " | ||
2868 | "address found in MPTABLE, " | ||
2869 | "disabling IO/APIC support!\n"); | ||
2870 | smp_found_config = 0; | ||
2871 | skip_ioapic_setup = 1; | ||
2872 | goto fake_ioapic_page; | ||
2873 | } | ||
2874 | } else { | ||
2875 | fake_ioapic_page: | ||
2876 | ioapic_phys = (unsigned long) | ||
2877 | alloc_bootmem_pages(PAGE_SIZE); | ||
2878 | ioapic_phys = __pa(ioapic_phys); | ||
2879 | } | ||
2880 | set_fixmap_nocache(idx, ioapic_phys); | ||
2881 | printk(KERN_DEBUG "mapped IOAPIC to %08lx (%08lx)\n", | ||
2882 | __fix_to_virt(idx), ioapic_phys); | ||
2883 | idx++; | ||
2884 | } | ||
2885 | } | ||
2886 | |||