diff options
Diffstat (limited to 'static/freebsd/man4/io.4 3.html')
| -rw-r--r-- | static/freebsd/man4/io.4 3.html | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/static/freebsd/man4/io.4 3.html b/static/freebsd/man4/io.4 3.html new file mode 100644 index 00000000..d26e4c65 --- /dev/null +++ b/static/freebsd/man4/io.4 3.html @@ -0,0 +1,95 @@ +<table class="head"> + <tr> + <td class="head-ltitle">IO(4)</td> + <td class="head-vol">Device Drivers Manual</td> + <td class="head-rtitle">IO(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">io</code> — <span class="Nd">I/O privilege + file</span></p> +</section> +<section class="Sh"> +<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> +<p class="Pp"><code class="Cd">device io</code></p> +<p class="Pp"> + <br/> + <code class="In">#include <<a class="In">sys/types.h</a>></code> + <br/> + <code class="In">#include <<a class="In">sys/ioctl.h</a>></code> + <br/> + <code class="In">#include <<a class="In">dev/io/iodev.h</a>></code> + <br/> + <code class="In">#include <<a class="In">machine/iodev.h</a>></code></p> +<div class="Bd Pp Li"> +<pre>struct iodev_pio_req { + u_int access; + u_int port; + u_int width; + u_int val; +};</pre> +</div> +</section> +<section class="Sh"> +<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> +<p class="Pp">The special file <span class="Pa">/dev/io</span> is a controlled + security hole that allows a process to gain I/O privileges (which are + normally reserved for kernel-internal code). This can be useful in order to + write userland programs that handle some hardware directly.</p> +<p class="Pp">The usual operations on the device are to open it via the + <a class="Xr">open(2)</a> interface and to send I/O requests to the file + descriptor using the <a class="Xr">ioctl(2)</a> syscall.</p> +<p class="Pp">The <a class="Xr">ioctl(2)</a> requests available for + <span class="Pa">/dev/io</span> are mostly platform dependent, but there are + also some in common between all of them. The + <code class="Dv">IODEV_PIO</code> is used by all the architectures in order + to request that an I/O operation be performed. It takes a 'struct + iodev_pio_req' argument that must be previously setup.</p> +<p class="Pp">The <var class="Fa">access</var> member specifies the type of + operation requested. It may be:</p> +<dl class="Bl-tag"> + <dt id="IODEV_PIO_READ"><a class="permalink" href="#IODEV_PIO_READ"><code class="Dv">IODEV_PIO_READ</code></a></dt> + <dd>The operation is an "in" type. A value will be read from the + specified port (retrieved from the <var class="Fa">port</var> member) and + the result will be stored in the <var class="Fa">val</var> member.</dd> + <dt id="IODEV_PIO_WRITE"><a class="permalink" href="#IODEV_PIO_WRITE"><code class="Dv">IODEV_PIO_WRITE</code></a></dt> + <dd>The operation is a "out" type. The value will be fetched from + the <var class="Fa">val</var> member and will be written out to the + specified port (defined as the <var class="Fa">port</var> member).</dd> +</dl> +<p class="Pp">Finally, the <var class="Fa">width</var> member specifies the size + of the operand to be read/written, expressed in bytes.</p> +<p class="Pp">In addition to any file access permissions on + <span class="Pa">/dev/io</span>, the kernel enforces that only the + super-user may open this device.</p> +</section> +<section class="Sh"> +<h1 class="Sh" id="LEGACY"><a class="permalink" href="#LEGACY">LEGACY</a></h1> +<p class="Pp">The <span class="Pa">/dev/io</span> interface used to be very i386 + specific and worked differently. The initial implementation simply raised + the <a class="permalink" href="#IOPL"><i class="Em" id="IOPL">IOPL</i></a> + of the current thread when <a class="Xr">open(2)</a> was called on the + device. This behaviour is retained in the current implementation as legacy + support for both i386 and amd64 architectures.</p> +</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">close(2)</a>, <a class="Xr">i386_get_ioperm(2)</a>, + <a class="Xr">i386_set_ioperm(2)</a>, <a class="Xr">ioctl(2)</a>, + <a class="Xr">open(2)</a>, <a class="Xr">mem(4)</a></p> +</section> +<section class="Sh"> +<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> +<p class="Pp">The <code class="Nm">io</code> file appeared in + <span class="Ux">FreeBSD 1.0</span>.</p> +</section> +</div> +<table class="foot"> + <tr> + <td class="foot-date">June 1, 2010</td> + <td class="foot-os">FreeBSD 15.0</td> + </tr> +</table> |
