]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/smpboot.c
arch/x86/kernel/smpboot.c: fix warning
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / smpboot.c
index a74a261c5626068793903255a14c3a1829de5c17..f35c2d8016ac412c1c0433bf4382829c1d2cef31 100644 (file)
@@ -181,13 +181,12 @@ static void map_cpu_to_logical_apicid(void)
        map_cpu_to_node(cpu, node);
 }
 
-static void unmap_cpu_to_logical_apicid(int cpu)
+void numa_remove_cpu(int cpu)
 {
        cpu_2_logical_apicid[cpu] = BAD_APICID;
        unmap_cpu_to_node(cpu);
 }
 #else
-#define unmap_cpu_to_logical_apicid(cpu) do {} while (0)
 #define map_cpu_to_logical_apicid()  do {} while (0)
 #endif
 
@@ -329,15 +328,8 @@ static void __cpuinit start_secondary(void *unused)
         * smp_call_function().
         */
        lock_ipi_call_lock();
-#ifdef CONFIG_X86_64
-       spin_lock(&vector_lock);
-
-       /* Setup the per cpu irq handling data structures */
-       __setup_vector_irq(smp_processor_id());
-       /*
-        * Allow the master to continue.
-        */
-       spin_unlock(&vector_lock);
+#ifdef CONFIG_X86_IO_APIC
+       setup_vector_irq(smp_processor_id());
 #endif
        cpu_set(smp_processor_id(), cpu_online_map);
        unlock_ipi_call_lock();
@@ -351,7 +343,6 @@ static void __cpuinit start_secondary(void *unused)
 
 static void __cpuinit smp_apply_quirks(struct cpuinfo_x86 *c)
 {
-#ifdef CONFIG_X86_32
        /*
         * Mask B, Pentium, but not Pentium MMX
         */
@@ -401,7 +392,6 @@ static void __cpuinit smp_apply_quirks(struct cpuinfo_x86 *c)
 
 valid_k7:
        ;
-#endif
 }
 
 static void __cpuinit smp_checks(void)
@@ -874,7 +864,6 @@ do_rest:
        irq_ctx_init(cpu);
 #else
        cpu_pda(cpu)->pcurrent = c_idle.idle;
-       load_sp0(&per_cpu(init_tss, cpu), &c_idle.idle->thread);
        clear_tsk_thread_flag(c_idle.idle, TIF_FORK);
 #endif
        early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu);
@@ -950,15 +939,12 @@ do_rest:
                                inquire_remote_apic(apicid);
                }
        }
-
+#ifdef CONFIG_X86_64
 restore_state:
-
+#endif
        if (boot_error) {
                /* Try to put things back the way they were before ... */
-               unmap_cpu_to_logical_apicid(cpu);
-#ifdef CONFIG_X86_64
                numa_remove_cpu(cpu); /* was set by numa_add_cpu */
-#endif
                cpu_clear(cpu, cpu_callout_map); /* was set by do_boot_cpu() */
                cpu_clear(cpu, cpu_initialized); /* was set by cpu_init() */
                cpu_clear(cpu, cpu_present_map);
@@ -1125,9 +1111,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
 
                localise_nmi_watchdog();
 
-#ifdef CONFIG_X86_32
                connect_bsp_APIC();
-#endif
                setup_local_APIC();
                end_local_APIC_setup();
                return -1;
@@ -1155,7 +1139,6 @@ static void __init smp_cpu_index_default(void)
 void __init native_smp_prepare_cpus(unsigned int max_cpus)
 {
        preempt_disable();
-       nmi_watchdog_default();
        smp_cpu_index_default();
        current_cpu_data = boot_cpu_data;
        cpu_callin_map = cpumask_of_cpu(0);
@@ -1182,9 +1165,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
        }
        preempt_enable();
 
-#ifdef CONFIG_X86_32
        connect_bsp_APIC();
-#endif
+
        /*
         * Switch from PIC to APIC mode.
         */
@@ -1243,23 +1225,6 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
 
 #ifdef CONFIG_HOTPLUG_CPU
 
-#  ifdef CONFIG_X86_32
-void cpu_exit_clear(void)
-{
-       int cpu = raw_smp_processor_id();
-
-       idle_task_exit();
-
-       cpu_uninit();
-       irq_ctx_exit(cpu);
-
-       cpu_clear(cpu, cpu_callout_map);
-       cpu_clear(cpu, cpu_callin_map);
-
-       unmap_cpu_to_logical_apicid(cpu);
-}
-#  endif /* CONFIG_X86_32 */
-
 static void remove_siblinginfo(int cpu)
 {
        int sibling;
@@ -1313,12 +1278,20 @@ __init void prefill_possible_map(void)
        int i;
        int possible;
 
+       /* no processor from mptable or madt */
+       if (!num_processors)
+               num_processors = 1;
+
+#ifdef CONFIG_HOTPLUG_CPU
        if (additional_cpus == -1) {
                if (disabled_cpus > 0)
                        additional_cpus = disabled_cpus;
                else
                        additional_cpus = 0;
        }
+#else
+       additional_cpus = 0;
+#endif
        possible = num_processors + additional_cpus;
        if (possible > NR_CPUS)
                possible = NR_CPUS;
@@ -1335,13 +1308,11 @@ __init void prefill_possible_map(void)
 static void __ref remove_cpu_from_maps(int cpu)
 {
        cpu_clear(cpu, cpu_online_map);
-#ifdef CONFIG_X86_64
        cpu_clear(cpu, cpu_callout_map);
        cpu_clear(cpu, cpu_callin_map);
        /* was set by cpu_init() */
        clear_bit(cpu, (unsigned long *)&cpu_initialized);
        numa_remove_cpu(cpu);
-#endif
 }
 
 int __cpu_disable(void)