1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
.\" $OpenBSD: openprom.4,v 1.2 2001/10/24 21:15:32 miod Exp $g
.\" Copyright (c) 1992, 1993g
.\" The Regents of the University of California. All rights reserved.g
.\"g
.\" This software was developed by the Computer Systems Engineering groupg
.\" at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 andg
.\" contributed to Berkeley.g
.\"g
.\" Redistribution and use in source and binary forms, with or withoutg
.\" modification, are permitted provided that the following conditionsg
.\" are met:g
.\" 1. Redistributions of source code must retain the above copyrightg
.\" notice, this list of conditions and the following disclaimer.g
.\" 2. Redistributions in binary form must reproduce the above copyrightg
.\" notice, this list of conditions and the following disclaimer in theg
.\" documentation and/or other materials provided with the distribution.g
.\" 3. All advertising materials mentioning features or use of this softwareg
.\" must display the following acknowledgement:g
.\" This product includes software developed by the University ofg
.\" California, Berkeley and its contributors.g
.\" 4. Neither the name of the University nor the names of its contributorsg
.\" may be used to endorse or promote products derived from this softwareg
.\" without specific prior written permission.g
.\"g
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' ANDg
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEg
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSEg
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLEg
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALg
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODSg
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)g
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTg
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAYg
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OFg
.\" SUCH DAMAGE.g
.\"g
.\" from: @(#)openprom.4 8.1 (Berkeley) 6/5/93g
.\"g
.Dd October 5, 2001g
.Dt OPENPROM 4 sparc64g
.Osg
.Sh NAMEg
.Nm openpromg
.Nd OPENPROM interfaceg
.Sh SYNOPSISg
.Fd #include <machine/openpromio.h>g
.Sh DESCRIPTIONg
The fileg
.Nm /dev/openpromg
is an interface to the ULTRAsparc OPENPROM.g
This interface is highly stylized;g
ioctls are used for all operations.g
These ioctls refer tog
.Dq nodes ,g
which are simplyg
.Dq magicg
integer values describing data areas.g
Occasionally the number 0 may be used or returned instead,g
as described below.g
.Ppg
The calls that take and/or return a nodeg
use a pointer to ang
.Li intg
variable for this purpose;g
others use a pointer to ang
.Li struct opiocdescg
descriptor,g
which contains a node and two counted strings.g
The first string is comprised of the fieldsg
.Li op_nameleng
(ang
.Li int )g
andg
.Li op_nameg
(ag
.Li "char *" ) ,g
giving the name of a field.g
The second string is comprised of the fieldsg
.Li op_bufleng
andg
.Li op_buf ,g
used analogously.g
These two counted strings work in ag
.Dq value-resultg
fashion.g
At entry to the ioctl,g
the counts are expected to reflect the buffer size;g
on return,g
the counts are updated to reflect the buffer contents.g
.Ppg
The following ioctls are supported:g
.Bl -tag -width OPIOCGETOPTNODEg
.It Dv OPIOCGETOPTNODEg
Takes nothing, and fills in the options node number.g
.It OPIOCGETNEXTg
Takes a node number and returns the number of the following node.g
The node following the last node is number 0;g
the node following number 0 is the first node.g
.It Dv OPIOCGETCHILDg
Takes a node number and returns the number of the firstg
.Dq childg
of that node.g
This child may have siblings; these can be discovered by usingg
.Dv OPIOCGETNEXT .g
.It Dv OPIOCGETg
Fills in the value of the named property for the given node.g
If no such property is associated with that node,g
the value length is set to -1.g
If the named property exists but has no value,g
the value length is set to 0.g
.It Dv OPIOCSETg
Writes the given value under the given name.g
The OPENPROM may refuse this operation;g
in this caseg
.Dv EINVALg
is returned.g
.It Dv OPIOCNEXTPROPg
Finds the property whose name follows the given nameg
in OPENPROM internal order.g
The resulting name is returned in the value field.g
If the named property is the last, theg
.Dq nextg
name is the empty string.g
As withg
.Dv OPIOCGETNEXT ,g
the next name after the empty string is the first name.g
.Elg
.Sh FILESg
.Pa /dev/openpromg
.Sh ERRORSg
The following may result in rejection of an operation:g
.Bl -tag -width Erg
.It Bq Er EINVALg
The given node numberg
is not zerog
and does not correspond to any valid node,g
or is zero where zero is not allowed.g
.It Bq Er EBADFg
The requested operation requires permissions not specified at the call tog
.Fn open .g
.It Bq Er ENAMETOOLONGg
The given name or value fieldg
exceeds the maximum allowed length (8191 bytes).g
.Elg
.Sh SEE ALSOg
.Xr ioctl 2g
.Sh BUGSg
Due to limitations within the OPENPROM itself,g
these functions run at elevated priorityg
and may adversely affect system performance.g
.Sh HISTORYg
Ag
sparc64g
.Nm openpromg
manual page first appeared ing
.Ox 3.0 .g
|