Convert cpu_sibling_map to be a per cpu variable
[linux-block.git] / arch / ia64 / kernel / setup.c
index 4d9864cc92c90bb0fe7d31033db07bb76fbe84e4..777c8d8bd5e70febf80c8e5a8ed0c5d94d85de40 100644 (file)
@@ -60,7 +60,7 @@
 #include <asm/smp.h>
 #include <asm/system.h>
 #include <asm/unistd.h>
-#include <asm/system.h>
+#include <asm/hpsim.h>
 
 #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
 # error "struct cpuinfo_ia64 too big!"
@@ -390,6 +390,8 @@ early_console_setup (char *cmdline)
        if (!efi_setup_pcdp_console(cmdline))
                earlycons++;
 #endif
+       if (!simcons_register())
+               earlycons++;
 
        return (earlycons) ? 0 : -1;
 }
@@ -491,12 +493,17 @@ setup_arch (char **cmdline_p)
        efi_init();
        io_port_init();
 
-       parse_early_param();
-
 #ifdef CONFIG_IA64_GENERIC
-       machvec_init(NULL);
+       /* machvec needs to be parsed from the command line
+        * before parse_early_param() is called to ensure
+        * that ia64_mv is initialised before any command line
+        * settings may cause console setup to occur
+        */
+       machvec_init_from_cmdline(*cmdline_p);
 #endif
 
+       parse_early_param();
+
        if (early_console_setup(*cmdline_p) == 0)
                mark_bsp_online();
 
@@ -521,10 +528,6 @@ setup_arch (char **cmdline_p)
 
 #ifdef CONFIG_SMP
        cpu_physical_id(0) = hard_smp_processor_id();
-
-       cpu_set(0, cpu_sibling_map[0]);
-       cpu_set(0, cpu_core_map[0]);
-
        check_for_logical_procs();
        if (smp_num_cpucores > 1)
                printk(KERN_INFO
@@ -866,6 +869,14 @@ cpu_init (void)
        void *cpu_data;
 
        cpu_data = per_cpu_init();
+       /*
+        * insert boot cpu into sibling and core mapes
+        * (must be done after per_cpu area is setup)
+        */
+       if (smp_processor_id() == 0) {
+               cpu_set(0, per_cpu(cpu_sibling_map, 0));
+               cpu_set(0, cpu_core_map[0]);
+       }
 
        /*
         * We set ar.k3 so that assembly code in MCA handler can compute
@@ -949,6 +960,11 @@ cpu_init (void)
 
        /* clear TPR & XTP to enable all interrupt classes: */
        ia64_setreg(_IA64_REG_CR_TPR, 0);
+
+       /* Clear any pending interrupts left by SAL/EFI */
+       while (ia64_get_ivr() != IA64_SPURIOUS_INT_VECTOR)
+               ia64_eoi();
+
 #ifdef CONFIG_SMP
        normal_xtp();
 #endif
@@ -980,15 +996,6 @@ cpu_init (void)
        pm_idle = default_idle;
 }
 
-/*
- * On SMP systems, when the scheduler does migration-cost autodetection,
- * it needs a way to flush as much of the CPU's caches as possible.
- */
-void sched_cacheflush(void)
-{
-       ia64_sal_cache_flush(3);
-}
-
 void __init
 check_bugs (void)
 {