summaryrefslogtreecommitdiff
path: root/static/netbsd/man4/man4.prep/nvram.4 3.html
blob: b482312690d3db487bdc612f6f5e5a2d63317c1c (plain)
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
<table class="head">
  <tr>
    <td class="head-ltitle">NVRAM(4)</td>
    <td class="head-vol">Device Drivers Manual (prep)</td>
    <td class="head-rtitle">NVRAM(4)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">nvram</code> &#x2014; <span class="Nd">PReP nvram
    interface</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
    &lt;<a class="In">machine/nvram.h</a>&gt;</code></p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The file <code class="Nm">/dev/nvram</code> 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.</p>
<p class="Pp">The calls that take and/or return a variable use a pointer to an
    <code class="Li">int</code> variable for this purpose; others use a pointer
    to an <code class="Li">struct pnviocdesc</code> descriptor, which contains a
    variable and two counted strings. The first string comprises the fields
    <code class="Li">pnv_namelen</code> (an <code class="Li">int</code>) and
    <code class="Li">pnv_name</code> (a <code class="Li">char *</code>), giving
    the name of a field. The second string comprises the fields
    <code class="Li">pnv_buflen</code> and <code class="Li">pnv_buf</code>, used
    analogously. These two counted strings work in a
    &#x201C;value-result&#x201D; 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.</p>
<p class="Pp">The following ioctls are supported:</p>
<dl class="Bl-tag">
  <dt>PNVIOCGETNEXTNAME</dt>
  <dd>Takes a variable name and returns the name of the following variable. If a
      <code class="Dv">NULL</code> 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 <code class="Er">EINVAL</code>.</dd>
  <dt id="PNVIOCGET"><a class="permalink" href="#PNVIOCGET"><code class="Dv">PNVIOCGET</code></a></dt>
  <dd>Fills in the value of the named property for the given variable. If no
      such property is associated with that variable, the value length is set to
      -1. If the named property exists but has no value, the value length is set
      to 0.</dd>
  <dt id="PNVIOCSET"><a class="permalink" href="#PNVIOCSET"><code class="Dv">PNVIOCSET</code></a></dt>
  <dd>Writes the given value under the given name.</dd>
  <dt id="PNVIOCGETNUMGE"><a class="permalink" href="#PNVIOCGETNUMGE"><code class="Dv">PNVIOCGETNUMGE</code></a></dt>
  <dd>Returns the number of variables in the Global Environment Area.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
<p class="Pp"><span class="Pa">/dev/nvram</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="ERRORS"><a class="permalink" href="#ERRORS">ERRORS</a></h1>
<p class="Pp">The following may result in rejection of an operation:</p>
<dl class="Bl-tag">
  <dt id="EINVAL">[<a class="permalink" href="#EINVAL"><code class="Er">EINVAL</code></a>]</dt>
  <dd>The given variable name does not exist; or the buffer set up to retrieve
      values from the nvram was not large enough to hold the result.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">ioctl(2)</a></p>
<p class="Pp"><span class="Pa">PowerPC Reference Platform Specification Version
    1.1, Section 5.5</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
<p class="Pp">Due to limitations within the <code class="Nm">nvram</code>
    itself, these functions run at elevated priority and may adversely affect
    system performance.</p>
<p class="Pp"><code class="Dv">PNVIOCSET</code> is not currently supported,
    making the <code class="Nm">nvram</code> driver read-only at this time.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">March 1, 2007</td>
    <td class="foot-os">NetBSD 10.1</td>
  </tr>
</table>