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 (c) 1991-1997,2001 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>
33 prom_interpret(char *string
, uintptr_t arg1
, uintptr_t arg2
, uintptr_t arg3
,
34 uintptr_t arg4
, uintptr_t arg5
)
40 * NB: It is not possible to provide a compatible interface
41 * here, if the size of an int is different from the size of a
42 * cell, since we don't know how to promote the arguments. We
43 * simply promote arguments treating them as unsigned integers;
44 * thus pointers will be properly promoted and negative signed
45 * integer value will not be properly promoted. This isn't an
46 * issue for LP64 client programs since this code will simply
47 * pass the entire 64-bit arguments through unchanged.
49 * XXX: This is not fully capable via this interface. Use
50 * p1275_cif_handler directly for all features. Specifically,
51 * there's no catch_result and no result cells available via this
52 * interface. This interface provided for compatibilty with
53 * existing OBP code. Note that we also assume that the
54 * arguments are not to be sign extended. Assuming the code
55 * using these arguments is written correctly, this should be OK.
58 ci
[0] = p1275_ptr2cell("interpret"); /* Service name */
59 ci
[1] = (cell_t
)6; /* #argument cells */
60 ci
[2] = (cell_t
)0; /* #return cells */
61 ci
[3] = p1275_ptr2cell(string
); /* Arg1: Interpreted string */
62 ci
[4] = p1275_uintptr2cell(arg1
); /* Arg2: stack arg 1 */
63 ci
[5] = p1275_uintptr2cell(arg2
); /* Arg3: stack arg 2 */
64 ci
[6] = p1275_uintptr2cell(arg3
); /* Arg4: stack arg 3 */
65 ci
[7] = p1275_uintptr2cell(arg4
); /* Arg5: stack arg 4 */
66 ci
[8] = p1275_uintptr2cell(arg5
); /* Arg6: stack arg 5 */
70 (void) p1275_cif_handler(&ci
);