openprom(4/macppc) | OPENPROM interface |
openprom(4/sparc64) | OPENPROM interface |
OPENPROM(4) | Device Drivers Manual (macppc) | OPENPROM(4) |
openprom
—
OPENPROM interface
#include
<machine/openpromio.h>
The file /dev/openprom is an interface to the Macintosh OPENPROM. This interface is highly stylized; ioctls are used for all operations. These ioctls refer to “nodes”, which are simply “magic” integer values describing data areas. Occasionally the number 0 may be used or returned instead, as described below.
The calls that take and/or return a node use a pointer to an
int
variable for this purpose; others use a pointer
to a struct opiocdesc
descriptor, which contains a
node and two counted strings. The first string is comprised of the fields
op_namelen
(an int
) and
op_name
(a char *
), giving
the name of a field. The second string is comprised of the fields
op_buflen
and op_buf
, used
analogously. These two counted strings work in a
“value-result” fashion. At entry to the ioctl, the counts are
expected to reflect the buffer size; on return, the counts are updated to
reflect the buffer contents.
The following ioctls are supported:
OPIOCGETOPTNODE
OPIOCGETNEXT
OPIOCGETCHILD
OPIOCGETNEXT
.OPIOCGET
OPIOCSET
EINVAL
is returned.OPIOCNEXTPROP
OPIOCGETNEXT
, the next name after the
empty string is the first name./dev/openprom
The following may result in rejection of an operation:
EINVAL
]EBADF
]open
().ENAMETOOLONG
]A macppc openprom
manual page first
appeared in OpenBSD 4.3.
Due to limitations within the OPENPROM itself, these functions run at elevated priority and may adversely affect system performance.
November 17, 2017 | OpenBSD-6.4 |