dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / psm / promif / ieee1275 / sun4u / prom_sunfire.c
blob60ea31bb5a33668db1efb7d5cfee3b4bd6a4a02c
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright (c) 1994-1998, by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <sys/promif.h>
30 #include <sys/promimpl.h>
32 /* SunFire only */
33 int
34 prom_sunfire_cpu_off(void)
36 cell_t ci[3];
38 /* Service name */
39 ci[0] = p1275_ptr2cell("SUNW,Ultra-Enterprise,cpu-off");
40 ci[1] = (cell_t)0; /* #argument cells */
41 ci[2] = (cell_t)0; /* #result cells */
44 * This is an unlocked entry into the prom.
46 * promif_preprom(), ... will be called by the controlling
47 * cpu. The controlling cpu handles prom contention
48 * while the victim is in transition.
50 (void) p1275_cif_handler(&ci);
52 return (0);
56 * These interfaces allow the client to attach/detach board.
58 int
59 prom_sunfire_attach_board(u_int board)
61 cell_t ci[5];
62 int rv;
64 ci[0] = p1275_ptr2cell("SUNW,Ultra-Enterprise,add-brd"); /* name */
65 ci[1] = (cell_t)1; /* #argument cells */
66 ci[2] = (cell_t)1; /* #result cells */
67 ci[3] = p1275_uint2cell(board);
69 promif_preprom();
70 rv = p1275_cif_handler(&ci);
71 promif_postprom();
73 if (rv != 0)
74 return (rv);
75 if (p1275_cell2int(ci[4]) != 0) /* Res1: Catch result */
76 return (-1);
78 return (0);
81 int
82 prom_sunfire_detach_board(u_int board)
84 cell_t ci[5];
85 int rv;
87 ci[0] = p1275_ptr2cell("SUNW,Ultra-Enterprise,rm-brd"); /* name */
88 ci[1] = (cell_t)1; /* #argument cells */
89 ci[2] = (cell_t)1; /* #result cells */
90 ci[3] = p1275_uint2cell(board);
92 promif_preprom();
93 rv = p1275_cif_handler(&ci);
94 promif_postprom();
96 if (rv != 0)
97 return (rv);
98 if (p1275_cell2int(ci[4]) != 0) /* Res1: Catch result */
99 return (-1);
101 return (0);