1 /* $Id: c_mp.c,v 1.3 1995/11/25 00:57:50 davem Exp $
2 * mp.c: SMP cpu idling and dispatch on the Sparc.
3 *
4 * Copyright (C) 1995 David S. Miller
5 */
6
7 #include <linux/kernel.h>
8
9 #include <asm/mp.h>
10 #include <asm/mbus.h>
11
12 struct sparc_percpu *percpu_table;
13
14 void
15 sparc_cpu_init(void)
/* ![[previous]](../icons/n_left.png)
![[next]](../icons/right.png)
![[first]](../icons/n_first.png)
![[last]](../icons/last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
16 {
17 /* We now have our per-cpu mappings ok, and we should
18 * be good to go.
19 */
20
21 /* Do cache crap here. */
22
23 /* CPU initted, idle the puppy. */
24
25 return;
26 }
27
28 extern thiscpus_mid;
29
30 void
31 sparc_cpu_idle(void)
/* ![[previous]](../icons/left.png)
![[next]](../icons/n_right.png)
![[first]](../icons/first.png)
![[last]](../icons/n_last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
32 {
33 int cpuid;
34
35 /* cpuid = get_cpuid(); */
36 cpuid = (thiscpus_mid&(~8));
37 /* printk("SMP: cpu%d has entered idle loop", cpuid); */
38
39 /* Say that we exist and set up. */
40 percpu_table[cpuid].cpuid = cpuid;
41 percpu_table[cpuid].cpu_is_alive = 0x1;
42 percpu_table[cpuid].cpu_is_idling = 0x1;
43
44 /* Let other cpus catch up. */
45 while(linux_smp_still_initting) ;
46 printk("cpu%d done spinning\n", get_cpuid());
47 for(;;) ; /* Do something useful here... */
48
49 return;
50 }