4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <sys/promif.h>
30 #include <sys/promimpl.h>
33 prom_stopcpu_bycpuid(int cpuid
)
37 ci
[0] = p1275_ptr2cell("SUNW,stop-cpu-by-cpuid"); /* Service name */
38 ci
[1] = (cell_t
)1; /* #argument cells */
39 ci
[2] = (cell_t
)1; /* #result cells */
40 ci
[3] = p1275_int2cell(cpuid
); /* Arg1: cpuid to stop */
43 (void) p1275_cif_handler(&ci
);
46 return (p1275_cell2int(ci
[4]));
51 prom_startcpu(pnode_t node
, caddr_t pc
, int arg
)
55 ci
[0] = p1275_ptr2cell("SUNW,start-cpu"); /* Service name */
56 ci
[1] = (cell_t
)3; /* #argument cells */
57 ci
[2] = (cell_t
)0; /* #result cells */
58 ci
[3] = p1275_dnode2cell(node
); /* Arg1: nodeid to start */
59 ci
[4] = p1275_ptr2cell(pc
); /* Arg2: pc */
60 ci
[5] = p1275_int2cell(arg
); /* Arg3: cpuid */
63 (void) p1275_cif_handler(&ci
);
70 prom_startcpu_bycpuid(int cpuid
, caddr_t pc
, int arg
)
74 ci
[0] = p1275_ptr2cell("SUNW,start-cpu-by-cpuid"); /* Service name */
75 ci
[1] = (cell_t
)3; /* #argument cells */
76 ci
[2] = (cell_t
)1; /* #result cells */
77 ci
[3] = p1275_int2cell(cpuid
); /* Arg1: cpuid to start */
78 ci
[4] = p1275_ptr2cell(pc
); /* Arg2: pc */
79 ci
[5] = p1275_int2cell(arg
); /* Arg3: cpuid */
82 (void) p1275_cif_handler(&ci
);
85 return (p1275_cell2int(ci
[6]));
89 prom_wakeupcpu(pnode_t node
)
94 ci
[0] = p1275_ptr2cell("SUNW,wakeup-cpu"); /* Service name */
95 ci
[1] = (cell_t
)1; /* #argument cells */
96 ci
[2] = (cell_t
)1; /* #result cells */
97 ci
[3] = p1275_dnode2cell(node
); /* Arg1: nodeid to wakeup */
100 rv
= p1275_cif_handler(&ci
);
106 return (p1275_cell2int(ci
[4])); /* Res1: Catch result */
110 prom_cpuoff(pnode_t node
)
115 ci
[0] = p1275_ptr2cell("SUNW,park-cpu");
116 ci
[1] = (cell_t
)1; /* #argument cells */
117 ci
[2] = (cell_t
)1; /* #return cells */
118 ci
[3] = p1275_dnode2cell(node
);
121 rv
= p1275_cif_handler(&ci
);
127 return (p1275_cell2int(ci
[4]));
131 prom_hotaddcpu(int cpuid
)
135 ci
[0] = p1275_ptr2cell("SUNW,hotadd-cpu-by-cpuid"); /* Service name */
136 ci
[1] = (cell_t
)1; /* #argument cells */
137 ci
[2] = (cell_t
)1; /* #result cells */
138 ci
[3] = p1275_int2cell(cpuid
); /* Arg1: cpuid to start */
141 (void) p1275_cif_handler(&ci
);
144 return (p1275_cell2int(ci
[4]));
148 prom_hotremovecpu(int cpuid
)
152 ci
[0] = p1275_ptr2cell("SUNW,hotremove-cpu-by-cpuid"); /* Service */
153 ci
[1] = (cell_t
)1; /* #argument cells */
154 ci
[2] = (cell_t
)1; /* #result cells */
155 ci
[3] = p1275_int2cell(cpuid
); /* Arg1: cpuid to start */
158 (void) p1275_cif_handler(&ci
);
161 return (p1275_cell2int(ci
[4]));