smp_32.c (f0a2bc7e54bb51f64d4c2cd5942ba6018a13d762) smp_32.c (6e54e9503ea84f2c3571cda7146fb42184f0d7e6)
1/* smp.c: Sparc SMP support.
2 *
3 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
4 * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
5 * Copyright (C) 2004 Keith M Wesolowski (wesolows@foobazco.org)
6 */
7
8#include <asm/head.h>

--- 71 unchanged lines hidden (view full) ---

80 bogosum += cpu_data(cpu).udelay_val;
81 }
82
83 printk("Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
84 num, bogosum/(500000/HZ),
85 (bogosum/(5000/HZ))%100);
86
87 switch(sparc_cpu_model) {
1/* smp.c: Sparc SMP support.
2 *
3 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
4 * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
5 * Copyright (C) 2004 Keith M Wesolowski (wesolows@foobazco.org)
6 */
7
8#include <asm/head.h>

--- 71 unchanged lines hidden (view full) ---

80 bogosum += cpu_data(cpu).udelay_val;
81 }
82
83 printk("Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
84 num, bogosum/(500000/HZ),
85 (bogosum/(5000/HZ))%100);
86
87 switch(sparc_cpu_model) {
88 case sun4:
89 printk("SUN4\n");
90 BUG();
91 break;
92 case sun4c:
93 printk("SUN4C\n");
94 BUG();
95 break;
96 case sun4m:
97 smp4m_smp_done();
98 break;
99 case sun4d:
100 smp4d_smp_done();
101 break;
102 case sparc_leon:
103 leon_smp_done();

--- 192 unchanged lines hidden (view full) ---

296 cpumask_t cpu_mask;
297 cpumask_copy(&cpu_mask, mm_cpumask(mm));
298 cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
299 if (!cpumask_empty(&cpu_mask))
300 xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr);
301 local_flush_sig_insns(mm, insn_addr);
302}
303
88 case sun4m:
89 smp4m_smp_done();
90 break;
91 case sun4d:
92 smp4d_smp_done();
93 break;
94 case sparc_leon:
95 leon_smp_done();

--- 192 unchanged lines hidden (view full) ---

288 cpumask_t cpu_mask;
289 cpumask_copy(&cpu_mask, mm_cpumask(mm));
290 cpumask_clear_cpu(smp_processor_id(), &cpu_mask);
291 if (!cpumask_empty(&cpu_mask))
292 xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr);
293 local_flush_sig_insns(mm, insn_addr);
294}
295
304extern unsigned int lvl14_resolution;
305
306/* /proc/profile writes can call this, don't __init it please. */
307static DEFINE_SPINLOCK(prof_setup_lock);
308
309int setup_profiling_timer(unsigned int multiplier)
310{
296int setup_profiling_timer(unsigned int multiplier)
297{
311 int i;
312 unsigned long flags;
313
314 /* Prevent level14 ticker IRQ flooding. */
315 if((!multiplier) || (lvl14_resolution / multiplier) < 500)
316 return -EINVAL;
317
318 spin_lock_irqsave(&prof_setup_lock, flags);
319 for_each_possible_cpu(i) {
320 load_profile_irq(i, lvl14_resolution / multiplier);
321 prof_multiplier(i) = multiplier;
322 }
323 spin_unlock_irqrestore(&prof_setup_lock, flags);
324
325 return 0;
298 return -EINVAL;
326}
327
328void __init smp_prepare_cpus(unsigned int max_cpus)
329{
330 extern void __init smp4m_boot_cpus(void);
331 extern void __init smp4d_boot_cpus(void);
332 int i, cpuid, extra;
333

--- 6 unchanged lines hidden (view full) ---

340 }
341 /* i = number of cpus */
342 if (extra && max_cpus > i - extra)
343 printk("Warning: NR_CPUS is too low to start all cpus\n");
344
345 smp_store_cpu_info(boot_cpu_id);
346
347 switch(sparc_cpu_model) {
299}
300
301void __init smp_prepare_cpus(unsigned int max_cpus)
302{
303 extern void __init smp4m_boot_cpus(void);
304 extern void __init smp4d_boot_cpus(void);
305 int i, cpuid, extra;
306

--- 6 unchanged lines hidden (view full) ---

313 }
314 /* i = number of cpus */
315 if (extra && max_cpus > i - extra)
316 printk("Warning: NR_CPUS is too low to start all cpus\n");
317
318 smp_store_cpu_info(boot_cpu_id);
319
320 switch(sparc_cpu_model) {
348 case sun4:
349 printk("SUN4\n");
350 BUG();
351 break;
352 case sun4c:
353 printk("SUN4C\n");
354 BUG();
355 break;
356 case sun4m:
357 smp4m_boot_cpus();
358 break;
359 case sun4d:
360 smp4d_boot_cpus();
361 break;
362 case sparc_leon:
363 leon_boot_cpus();

--- 42 unchanged lines hidden (view full) ---

406 if (cpuid != 0)
407 printk("boot cpu id != 0, this could work but is untested\n");
408
409 current_thread_info()->cpu = cpuid;
410 set_cpu_online(cpuid, true);
411 set_cpu_possible(cpuid, true);
412}
413
321 case sun4m:
322 smp4m_boot_cpus();
323 break;
324 case sun4d:
325 smp4d_boot_cpus();
326 break;
327 case sparc_leon:
328 leon_boot_cpus();

--- 42 unchanged lines hidden (view full) ---

371 if (cpuid != 0)
372 printk("boot cpu id != 0, this could work but is untested\n");
373
374 current_thread_info()->cpu = cpuid;
375 set_cpu_online(cpuid, true);
376 set_cpu_possible(cpuid, true);
377}
378
414int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle)
379int __cpuinit __cpu_up(unsigned int cpu)
415{
380{
416 extern int __cpuinit smp4m_boot_one_cpu(int, struct task_struct *);
417 extern int __cpuinit smp4d_boot_one_cpu(int, struct task_struct *);
381 extern int __cpuinit smp4m_boot_one_cpu(int);
382 extern int __cpuinit smp4d_boot_one_cpu(int);
418 int ret=0;
419
420 switch(sparc_cpu_model) {
383 int ret=0;
384
385 switch(sparc_cpu_model) {
421 case sun4:
422 printk("SUN4\n");
423 BUG();
424 break;
425 case sun4c:
426 printk("SUN4C\n");
427 BUG();
428 break;
429 case sun4m:
386 case sun4m:
430 ret = smp4m_boot_one_cpu(cpu, tidle);
387 ret = smp4m_boot_one_cpu(cpu);
431 break;
432 case sun4d:
388 break;
389 case sun4d:
433 ret = smp4d_boot_one_cpu(cpu, tidle);
390 ret = smp4d_boot_one_cpu(cpu);
434 break;
435 case sparc_leon:
391 break;
392 case sparc_leon:
436 ret = leon_boot_one_cpu(cpu, tidle);
393 ret = leon_boot_one_cpu(cpu);
437 break;
438 case sun4e:
439 printk("SUN4E\n");
440 BUG();
441 break;
442 case sun4u:
443 printk("SUN4U\n");
444 BUG();

--- 36 unchanged lines hidden ---
394 break;
395 case sun4e:
396 printk("SUN4E\n");
397 BUG();
398 break;
399 case sun4u:
400 printk("SUN4U\n");
401 BUG();

--- 36 unchanged lines hidden ---