2 .\" Copyright (c) 1992, 1993
3 .\" The Regents of the University of California. All rights reserved.
5 .\" This software was developed by the Computer Systems Engineering group
6 .\" at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7 .\" contributed to Berkeley.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" from: @(#)openprom.4 8.1 (Berkeley) 6/5/93
34 .\" from: OpenBSD: openprom.4,v 1.9 2004/03/22 22:07:21 miod Exp
37 .\" Copyright (c) 2005 Marius Strobl <marius@FreeBSD.org>
38 .\" All rights reserved.
40 .\" Redistribution and use in source and binary forms, with or without
41 .\" modification, are permitted provided that the following conditions
44 .\" 1. Redistributions of source code must retain the above copyright
45 .\" notice, this list of conditions and the following disclaimer.
46 .\" 2. Redistributions in binary form must reproduce the above copyright
47 .\" notice, this list of conditions and the following disclaimer in the
48 .\" documentation and/or other materials provided with the distribution.
50 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
51 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
52 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
53 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
54 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
55 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
57 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
58 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
59 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64 .Dt OPENPROM 4 sparc64
68 .Nd "OPENPROM interface"
72 .In dev/ofw/openpromio.h
79 compatible interface to the
82 This interface is similar to the
87 calls for all operations.
88 These calls refer to the nodes in the
93 only implements a subset of the
99 The nodes are represented by integer values,
100 which are simply describing data areas.
101 Occasionally the number 0 may be used or returned instead,
104 All calls use a pointer to a
105 .Vt "struct openpromio"
107 which has the following definition:
117 member refers to the size of
121 member actually works like a union.
125 .Vt "struct openpromio"
126 is used to pass in or return data,
128 either contains an integer referring to a node or a string referring to a
129 property name or property value.
137 calls are currently implemented:
138 .Bl -tag -width ".Dv OPROMGETPROP"
140 Takes the number of a node and returns the number of the next node in the
143 The node following the last node is number 0.
144 The node following number 0 is the first node.
146 Takes the number of a node and returns the number of the first child of that
148 This child may have siblings.
149 These can be determined by using
151 If the node does not have a child,
154 Takes the name of a property.
155 Returns the property value.
158 call refers to the node previously returned by either the
163 depending on which one was invoked last.
164 If the property referenced by the given name is not associated with that node,
167 If the named property exists but has no value,
168 an empty string is returned.
170 Takes the name of a property.
171 Returns the name of the next property of the node.
177 call refers to the node previously returned by either the
182 If the property referenced by the given name is the last property of the node,
183 an empty string is returned.
186 .Bl -tag -width ".Pa /dev/openprom"
188 OPENPROM interface node
191 The following may result in rejection of an operation:
196 node is already opened.
198 The given node number is not 0 and does not correspond to any valid node,
199 or the given node number is 0 where 0 is not allowed,
200 or the given size value is invalid,
201 or the given property name exceeds the maximum allowed length of
205 The kernel could not allocate memory to copy in data from user-space or to
206 retrieve data from the
210 Due to limitations within
213 these functions run at elevated priority and may adversely affect system
218 interface exists entirely for compatibility with software like X11,
219 and only the features that are actually needed for that are implemented.
220 The interface sucks too much to actually use,
221 new code should use the
232 version to include the
239 interface was written by
240 .An "Jake Burkholder" Aq jake@FreeBSD.org .