1 /* $Id: mp.c,v 1.4 1995/11/25 01:00:06 davem Exp $
2 * mp.c: OpenBoot Prom Multiprocessor support routines. Don't call
3 * these on a UP or else you will halt and catch fire. ;)
4 *
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
6 */
7
8 #include <asm/openprom.h>
9 #include <asm/oplib.h>
10
11 /* Start cpu with prom-tree node 'cpunode' using context described
12 * by 'ctable_reg' in context 'ctx' at program counter 'pc'.
13 *
14 * XXX Have to look into what the return values mean. XXX
15 */
16 int
17 prom_startcpu(int cpunode, struct linux_prom_registers *ctable_reg, int ctx, char *pc)
/* ![[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)
*/
18 {
19 switch(prom_vers) {
20 case PROM_V0:
21 case PROM_V2:
22 break;
23 case PROM_V3:
24 case PROM_P1275:
25 return (*(romvec->v3_cpustart))(cpunode, (int) ctable_reg, ctx, pc);
26 break;
27 };
28
29 return -1;
30 }
31
32 /* Stop CPU with device prom-tree node 'cpunode'.
33 * XXX Again, what does the return value really mean? XXX
34 */
35 int
36 prom_stopcpu(int cpunode)
/* ![[previous]](../icons/left.png)
![[next]](../icons/right.png)
![[first]](../icons/first.png)
![[last]](../icons/last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
37 {
38 switch(prom_vers) {
39 case PROM_V0:
40 case PROM_V2:
41 break;
42 case PROM_V3:
43 case PROM_P1275:
44 return (*(romvec->v3_cpustop))(cpunode);
45 break;
46 };
47
48 return -1;
49 }
50
51 /* Make CPU with device prom-tree node 'cpunode' idle.
52 * XXX Return value, anyone? XXX
53 */
54 int
55 prom_idlecpu(int cpunode)
/* ![[previous]](../icons/left.png)
![[next]](../icons/right.png)
![[first]](../icons/first.png)
![[last]](../icons/last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
56 {
57 switch(prom_vers) {
58 case PROM_V0:
59 case PROM_V2:
60 break;
61 case PROM_V3:
62 case PROM_P1275:
63 return (*(romvec->v3_cpuidle))(cpunode);
64 break;
65 };
66
67 return -1;
68 }
69
70 /* Resume the execution of CPU with nodeid 'cpunode'.
71 * XXX Come on, somebody has to know... XXX
72 */
73 int
74 prom_restartcpu(int cpunode)
/* ![[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)
*/
75 {
76 switch(prom_vers) {
77 case PROM_V0:
78 case PROM_V2:
79 break;
80 case PROM_V3:
81 case PROM_P1275:
82 return (*(romvec->v3_cpuresume))(cpunode);
83 break;
84 };
85
86 return -1;
87 }