diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-26 16:39:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-27 12:28:43 -0400 |
commit | 6e15cf04860074ad032e88c306bea656bbdd0f22 (patch) | |
tree | c346383bb7563e8d66b2f4a502f875b259c34870 /arch/x86/kernel/setup.c | |
parent | be0ea69674ed95e1e98cb3687a241badc756d228 (diff) | |
parent | 60db56422043aaa455ac7f858ce23c273220f9d9 (diff) |
Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2
Conflicts:
arch/parisc/kernel/irq.c
arch/x86/include/asm/fixmap_64.h
arch/x86/include/asm/setup.h
kernel/irq/handle.c
Semantic merge:
arch/x86/include/asm/fixmap.h
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r-- | arch/x86/kernel/setup.c | 139 |
1 files changed, 112 insertions, 27 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 6a8811a69324..b746deb9ebc6 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -74,14 +74,15 @@ | |||
74 | #include <asm/e820.h> | 74 | #include <asm/e820.h> |
75 | #include <asm/mpspec.h> | 75 | #include <asm/mpspec.h> |
76 | #include <asm/setup.h> | 76 | #include <asm/setup.h> |
77 | #include <asm/arch_hooks.h> | ||
78 | #include <asm/efi.h> | 77 | #include <asm/efi.h> |
78 | #include <asm/timer.h> | ||
79 | #include <asm/i8259.h> | ||
79 | #include <asm/sections.h> | 80 | #include <asm/sections.h> |
80 | #include <asm/dmi.h> | 81 | #include <asm/dmi.h> |
81 | #include <asm/io_apic.h> | 82 | #include <asm/io_apic.h> |
82 | #include <asm/ist.h> | 83 | #include <asm/ist.h> |
83 | #include <asm/vmi.h> | 84 | #include <asm/vmi.h> |
84 | #include <setup_arch.h> | 85 | #include <asm/setup_arch.h> |
85 | #include <asm/bios_ebda.h> | 86 | #include <asm/bios_ebda.h> |
86 | #include <asm/cacheflush.h> | 87 | #include <asm/cacheflush.h> |
87 | #include <asm/processor.h> | 88 | #include <asm/processor.h> |
@@ -89,7 +90,7 @@ | |||
89 | 90 | ||
90 | #include <asm/system.h> | 91 | #include <asm/system.h> |
91 | #include <asm/vsyscall.h> | 92 | #include <asm/vsyscall.h> |
92 | #include <asm/smp.h> | 93 | #include <asm/cpu.h> |
93 | #include <asm/desc.h> | 94 | #include <asm/desc.h> |
94 | #include <asm/dma.h> | 95 | #include <asm/dma.h> |
95 | #include <asm/iommu.h> | 96 | #include <asm/iommu.h> |
@@ -97,7 +98,6 @@ | |||
97 | #include <asm/mmu_context.h> | 98 | #include <asm/mmu_context.h> |
98 | #include <asm/proto.h> | 99 | #include <asm/proto.h> |
99 | 100 | ||
100 | #include <mach_apic.h> | ||
101 | #include <asm/paravirt.h> | 101 | #include <asm/paravirt.h> |
102 | #include <asm/hypervisor.h> | 102 | #include <asm/hypervisor.h> |
103 | 103 | ||
@@ -112,6 +112,20 @@ | |||
112 | #define ARCH_SETUP | 112 | #define ARCH_SETUP |
113 | #endif | 113 | #endif |
114 | 114 | ||
115 | unsigned int boot_cpu_id __read_mostly; | ||
116 | |||
117 | #ifdef CONFIG_X86_64 | ||
118 | int default_cpu_present_to_apicid(int mps_cpu) | ||
119 | { | ||
120 | return __default_cpu_present_to_apicid(mps_cpu); | ||
121 | } | ||
122 | |||
123 | int default_check_phys_apicid_present(int boot_cpu_physical_apicid) | ||
124 | { | ||
125 | return __default_check_phys_apicid_present(boot_cpu_physical_apicid); | ||
126 | } | ||
127 | #endif | ||
128 | |||
115 | #ifndef CONFIG_DEBUG_BOOT_PARAMS | 129 | #ifndef CONFIG_DEBUG_BOOT_PARAMS |
116 | struct boot_params __initdata boot_params; | 130 | struct boot_params __initdata boot_params; |
117 | #else | 131 | #else |
@@ -586,20 +600,7 @@ static int __init setup_elfcorehdr(char *arg) | |||
586 | early_param("elfcorehdr", setup_elfcorehdr); | 600 | early_param("elfcorehdr", setup_elfcorehdr); |
587 | #endif | 601 | #endif |
588 | 602 | ||
589 | static int __init default_update_genapic(void) | 603 | static struct x86_quirks default_x86_quirks __initdata; |
590 | { | ||
591 | #ifdef CONFIG_X86_SMP | ||
592 | # if defined(CONFIG_X86_GENERICARCH) || defined(CONFIG_X86_64) | ||
593 | genapic->wakeup_cpu = wakeup_secondary_cpu_via_init; | ||
594 | # endif | ||
595 | #endif | ||
596 | |||
597 | return 0; | ||
598 | } | ||
599 | |||
600 | static struct x86_quirks default_x86_quirks __initdata = { | ||
601 | .update_genapic = default_update_genapic, | ||
602 | }; | ||
603 | 604 | ||
604 | struct x86_quirks *x86_quirks __initdata = &default_x86_quirks; | 605 | struct x86_quirks *x86_quirks __initdata = &default_x86_quirks; |
605 | 606 | ||
@@ -656,7 +657,6 @@ void __init setup_arch(char **cmdline_p) | |||
656 | #ifdef CONFIG_X86_32 | 657 | #ifdef CONFIG_X86_32 |
657 | memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); | 658 | memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); |
658 | visws_early_detect(); | 659 | visws_early_detect(); |
659 | pre_setup_arch_hook(); | ||
660 | #else | 660 | #else |
661 | printk(KERN_INFO "Command line: %s\n", boot_command_line); | 661 | printk(KERN_INFO "Command line: %s\n", boot_command_line); |
662 | #endif | 662 | #endif |
@@ -824,8 +824,7 @@ void __init setup_arch(char **cmdline_p) | |||
824 | #else | 824 | #else |
825 | num_physpages = max_pfn; | 825 | num_physpages = max_pfn; |
826 | 826 | ||
827 | if (cpu_has_x2apic) | 827 | check_x2apic(); |
828 | check_x2apic(); | ||
829 | 828 | ||
830 | /* How many end-of-memory variables you have, grandma! */ | 829 | /* How many end-of-memory variables you have, grandma! */ |
831 | /* need this before calling reserve_initrd */ | 830 | /* need this before calling reserve_initrd */ |
@@ -865,9 +864,7 @@ void __init setup_arch(char **cmdline_p) | |||
865 | 864 | ||
866 | reserve_initrd(); | 865 | reserve_initrd(); |
867 | 866 | ||
868 | #ifdef CONFIG_X86_64 | ||
869 | vsmp_init(); | 867 | vsmp_init(); |
870 | #endif | ||
871 | 868 | ||
872 | io_delay_init(); | 869 | io_delay_init(); |
873 | 870 | ||
@@ -893,12 +890,11 @@ void __init setup_arch(char **cmdline_p) | |||
893 | */ | 890 | */ |
894 | acpi_reserve_bootmem(); | 891 | acpi_reserve_bootmem(); |
895 | #endif | 892 | #endif |
896 | #ifdef CONFIG_X86_FIND_SMP_CONFIG | ||
897 | /* | 893 | /* |
898 | * Find and reserve possible boot-time SMP configuration: | 894 | * Find and reserve possible boot-time SMP configuration: |
899 | */ | 895 | */ |
900 | find_smp_config(); | 896 | find_smp_config(); |
901 | #endif | 897 | |
902 | reserve_crashkernel(); | 898 | reserve_crashkernel(); |
903 | 899 | ||
904 | #ifdef CONFIG_X86_64 | 900 | #ifdef CONFIG_X86_64 |
@@ -925,9 +921,7 @@ void __init setup_arch(char **cmdline_p) | |||
925 | map_vsyscall(); | 921 | map_vsyscall(); |
926 | #endif | 922 | #endif |
927 | 923 | ||
928 | #ifdef CONFIG_X86_GENERICARCH | ||
929 | generic_apic_probe(); | 924 | generic_apic_probe(); |
930 | #endif | ||
931 | 925 | ||
932 | early_quirks(); | 926 | early_quirks(); |
933 | 927 | ||
@@ -978,4 +972,95 @@ void __init setup_arch(char **cmdline_p) | |||
978 | #endif | 972 | #endif |
979 | } | 973 | } |
980 | 974 | ||
975 | #ifdef CONFIG_X86_32 | ||
981 | 976 | ||
977 | /** | ||
978 | * x86_quirk_pre_intr_init - initialisation prior to setting up interrupt vectors | ||
979 | * | ||
980 | * Description: | ||
981 | * Perform any necessary interrupt initialisation prior to setting up | ||
982 | * the "ordinary" interrupt call gates. For legacy reasons, the ISA | ||
983 | * interrupts should be initialised here if the machine emulates a PC | ||
984 | * in any way. | ||
985 | **/ | ||
986 | void __init x86_quirk_pre_intr_init(void) | ||
987 | { | ||
988 | if (x86_quirks->arch_pre_intr_init) { | ||
989 | if (x86_quirks->arch_pre_intr_init()) | ||
990 | return; | ||
991 | } | ||
992 | init_ISA_irqs(); | ||
993 | } | ||
994 | |||
995 | /** | ||
996 | * x86_quirk_intr_init - post gate setup interrupt initialisation | ||
997 | * | ||
998 | * Description: | ||
999 | * Fill in any interrupts that may have been left out by the general | ||
1000 | * init_IRQ() routine. interrupts having to do with the machine rather | ||
1001 | * than the devices on the I/O bus (like APIC interrupts in intel MP | ||
1002 | * systems) are started here. | ||
1003 | **/ | ||
1004 | void __init x86_quirk_intr_init(void) | ||
1005 | { | ||
1006 | if (x86_quirks->arch_intr_init) { | ||
1007 | if (x86_quirks->arch_intr_init()) | ||
1008 | return; | ||
1009 | } | ||
1010 | } | ||
1011 | |||
1012 | /** | ||
1013 | * x86_quirk_trap_init - initialise system specific traps | ||
1014 | * | ||
1015 | * Description: | ||
1016 | * Called as the final act of trap_init(). Used in VISWS to initialise | ||
1017 | * the various board specific APIC traps. | ||
1018 | **/ | ||
1019 | void __init x86_quirk_trap_init(void) | ||
1020 | { | ||
1021 | if (x86_quirks->arch_trap_init) { | ||
1022 | if (x86_quirks->arch_trap_init()) | ||
1023 | return; | ||
1024 | } | ||
1025 | } | ||
1026 | |||
1027 | static struct irqaction irq0 = { | ||
1028 | .handler = timer_interrupt, | ||
1029 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER, | ||
1030 | .mask = CPU_MASK_NONE, | ||
1031 | .name = "timer" | ||
1032 | }; | ||
1033 | |||
1034 | /** | ||
1035 | * x86_quirk_pre_time_init - do any specific initialisations before. | ||
1036 | * | ||
1037 | **/ | ||
1038 | void __init x86_quirk_pre_time_init(void) | ||
1039 | { | ||
1040 | if (x86_quirks->arch_pre_time_init) | ||
1041 | x86_quirks->arch_pre_time_init(); | ||
1042 | } | ||
1043 | |||
1044 | /** | ||
1045 | * x86_quirk_time_init - do any specific initialisations for the system timer. | ||
1046 | * | ||
1047 | * Description: | ||
1048 | * Must plug the system timer interrupt source at HZ into the IRQ listed | ||
1049 | * in irq_vectors.h:TIMER_IRQ | ||
1050 | **/ | ||
1051 | void __init x86_quirk_time_init(void) | ||
1052 | { | ||
1053 | if (x86_quirks->arch_time_init) { | ||
1054 | /* | ||
1055 | * A nonzero return code does not mean failure, it means | ||
1056 | * that the architecture quirk does not want any | ||
1057 | * generic (timer) setup to be performed after this: | ||
1058 | */ | ||
1059 | if (x86_quirks->arch_time_init()) | ||
1060 | return; | ||
1061 | } | ||
1062 | |||
1063 | irq0.mask = cpumask_of_cpu(0); | ||
1064 | setup_irq(0, &irq0); | ||
1065 | } | ||
1066 | #endif /* CONFIG_X86_32 */ | ||