NVRAM(4) | Device Drivers Manual (prep) | NVRAM(4) |
nvram
— PReP nvram
interface
#include
<machine/nvram.h>
The file /dev/nvram
is an interface to the
PReP NVRAM, including the Global Environment Area. This interface is highly
stylized; ioctls are used for all operations. These ioctls refer to
individual variables in the Global Environment Area and their values.
The calls that take and/or return a variable use a pointer to an
int
variable for this purpose; others use a pointer
to an struct pnviocdesc
descriptor, which contains a
variable and two counted strings. The first string comprises the fields
pnv_namelen
(an int
) and
pnv_name
(a char *
), giving
the name of a field. The second string comprises the fields
pnv_buflen
and pnv_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:
NULL
is passed as the variable name, the first
variable name will be returned. If the last variable is given as an
argument, the ioctl will return EINVAL
.PNVIOCGET
PNVIOCSET
PNVIOCGETNUMGE
/dev/nvram
The following may result in rejection of an operation:
EINVAL
]PowerPC Reference Platform Specification Version 1.1, Section 5.5
Due to limitations within the nvram
itself, these functions run at elevated priority and may adversely affect
system performance.
PNVIOCSET
is not currently supported,
making the nvram
driver read-only at this time.
March 1, 2007 | NetBSD 10.99 |