4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #pragma ident "%Z%%M% %I% %E% SMI"
28 #include <sys/promif.h>
29 #include <sys/promimpl.h>
32 * Test for existance of a specific P1275 client interface service
35 prom_test(char *service
)
39 ci
[0] = p1275_ptr2cell("test"); /* Service name */
40 ci
[1] = (cell_t
)1; /* #argument cells */
41 ci
[2] = (cell_t
)1; /* #result cells */
42 ci
[3] = p1275_ptr2cell(service
); /* Arg1: requested svc name */
43 ci
[4] = (cell_t
)-1; /* Res1: Prime result */
46 (void) p1275_cif_handler(&ci
);
49 return (p1275_cell2int(ci
[4])); /* Res1: missing flag */
53 prom_test_method(char *method
, pnode_t node
)
59 if (prom_test("test-method") == 0) {
60 ci
[0] = p1275_ptr2cell("test-method"); /* service */
61 ci
[1] = (cell_t
)2; /* #argument cells */
62 ci
[2] = (cell_t
)1; /* #result cells */
63 ci
[3] = p1275_dnode2cell(node
);
64 ci
[4] = p1275_ptr2cell(method
);
68 (void) p1275_cif_handler(&ci
);
70 rv
= p1275_cell2int(ci
[5]);
72 (void) prom_sprintf(buf
,
73 "\" %s\" h# %x find-method invert h# %p l!",
74 method
, node
, (void *)&rv
);
75 prom_interpret(buf
, 0, 0, 0, 0, 0);