Merge branch 'drm-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied...
[linux-drm-fsl-dcu.git] / arch / sparc64 / kernel / smp.c
index 39deb0346eb52aca362b785fe0aab27c08f8480f..1fac215252e403bc25af1fbc3a58fe88e22e3994 100644 (file)
@@ -123,7 +123,7 @@ void __init smp_store_cpu_info(int id)
               cpu_data(id).ecache_size, cpu_data(id).ecache_line_size);
 }
 
-static void smp_setup_percpu_timer(void);
+extern void setup_sparc64_timer(void);
 
 static volatile unsigned long callin_flag = 0;
 
@@ -138,7 +138,7 @@ void __init smp_callin(void)
 
        __flush_tlb_all();
 
-       smp_setup_percpu_timer();
+       setup_sparc64_timer();
 
        if (cheetah_pcache_forced_on)
                cheetah_enable_pcache();
@@ -175,8 +175,6 @@ void cpu_panic(void)
        panic("SMP bolixed\n");
 }
 
-static unsigned long current_tick_offset __read_mostly;
-
 /* This tick register synchronization scheme is taken entirely from
  * the ia64 port, see arch/ia64/kernel/smpboot.c for details and credit.
  *
@@ -259,7 +257,7 @@ void smp_synchronize_tick_client(void)
                                } else
                                        adj = -delta;
 
-                               tick_ops->add_tick(adj, current_tick_offset);
+                               tick_ops->add_tick(adj);
                        }
 #if DEBUG_TICK_SYNC
                        t[i].rt = rt;
@@ -1178,30 +1176,9 @@ void smp_penguin_jailcell(int irq, struct pt_regs *regs)
        preempt_enable();
 }
 
-static void __init smp_setup_percpu_timer(void)
-{
-       unsigned long pstate;
-
-       /* Guarantee that the following sequences execute
-        * uninterrupted.
-        */
-       __asm__ __volatile__("rdpr      %%pstate, %0\n\t"
-                            "wrpr      %0, %1, %%pstate"
-                            : "=r" (pstate)
-                            : "i" (PSTATE_IE));
-
-       tick_ops->init_tick(current_tick_offset);
-
-       /* Restore PSTATE_IE. */
-       __asm__ __volatile__("wrpr      %0, 0x0, %%pstate"
-                            : /* no outputs */
-                            : "r" (pstate));
-}
-
 void __init smp_tick_init(void)
 {
        boot_cpu_id = hard_smp_processor_id();
-       current_tick_offset = timer_tick_offset;
 }
 
 /* /proc/profile writes can call this, don't __init it please. */
@@ -1366,11 +1343,11 @@ void __init setup_per_cpu_areas(void)
        /* Copy section for each CPU (we discard the original) */
        goal = PERCPU_ENOUGH_ROOM;
 
-       __per_cpu_shift = 0;
-       for (size = 1UL; size < goal; size <<= 1UL)
+       __per_cpu_shift = PAGE_SHIFT;
+       for (size = PAGE_SIZE; size < goal; size <<= 1UL)
                __per_cpu_shift++;
 
-       ptr = alloc_bootmem(size * NR_CPUS);
+       ptr = alloc_bootmem_pages(size * NR_CPUS);
 
        __per_cpu_base = ptr - __per_cpu_start;