xref: /illumos-gate/usr/src/uts/intel/promif/prom_prop.c (revision dd72704bd9e794056c558153663c739e2012d721)
1 /*
2  * CDDL HEADER START
3  *
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.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * Stuff for mucking about with properties
29  */
30 
31 #include <sys/promif.h>
32 #include <sys/promimpl.h>
33 #include <sys/prom_emul.h>
34 
35 int
36 prom_getproplen(pnode_t nodeid, caddr_t name)
37 {
38 	return (promif_getproplen(nodeid, name));
39 }
40 
41 int
42 prom_getprop(pnode_t nodeid, caddr_t name, caddr_t value)
43 {
44 	return (promif_getprop(nodeid, name, value));
45 }
46 
47 caddr_t
48 prom_nextprop(pnode_t nodeid, caddr_t previous, caddr_t next)
49 {
50 	return (promif_nextprop(nodeid, previous, next));
51 }
52 
53 /* obsolete entries, not needed */
54 char *
55 prom_decode_composite_string(void *buf, size_t buflen, char *prev)
56 {
57 	if ((buf == 0) || (buflen == 0) || ((int)buflen == -1))
58 		return ((char *)0);
59 
60 	if (prev == 0)
61 		return ((char *)buf);
62 
63 	prev += strlen(prev) + 1;
64 	if (prev >= ((char *)buf + buflen))
65 		return ((char *)0);
66 	return (prev);
67 }
68 
69 /*ARGSUSED*/
70 int
71 prom_bounded_getprop(pnode_t nodeid, caddr_t name, caddr_t value, int len)
72 {
73 	return (-1);
74 }
75