133 lines
4.5 KiB
HTML
133 lines
4.5 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of OUTB</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>OUTB</H1>
|
|
Section: Linux Programmer's Manual (2)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
outb, outw, outl, outsb, outsw, outsl,
|
|
inb, inw, inl, insb, insw, insl,
|
|
outb_p, outw_p, outl_p, inb_p, inw_p, inl_p - port I/O
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<PRE>
|
|
<B>#include <<A HREF="file:///usr/include/sys/io.h">sys/io.h</A>></B>
|
|
|
|
<B>unsigned char inb(unsigned short int </B><I>port</I><B>);</B>
|
|
<B>unsigned char inb_p(unsigned short int </B><I>port</I><B>);</B>
|
|
<B>unsigned short int inw(unsigned short int </B><I>port</I><B>);</B>
|
|
<B>unsigned short int inw_p(unsigned short int </B><I>port</I><B>);</B>
|
|
<B>unsigned int inl(unsigned short int </B><I>port</I><B>);</B>
|
|
<B>unsigned int inl_p(unsigned short int </B><I>port</I><B>);</B>
|
|
|
|
<B>void outb(unsigned char </B><I>value</I><B>, unsigned short int </B><I>port</I><B>);</B>
|
|
<B>void outb_p(unsigned char </B><I>value</I><B>, unsigned short int </B><I>port</I><B>);</B>
|
|
<B>void outw(unsigned short int </B><I>value</I><B>, unsigned short int </B><I>port</I><B>);</B>
|
|
<B>void outw_p(unsigned short int </B><I>value</I><B>, unsigned short int </B><I>port</I><B>);</B>
|
|
<B>void outl(unsigned int </B><I>value</I><B>, unsigned short int </B><I>port</I><B>);</B>
|
|
<B>void outl_p(unsigned int </B><I>value</I><B>, unsigned short int </B><I>port</I><B>);</B>
|
|
|
|
<B>void insb(unsigned short int </B><I>port</I><B>, void *</B><I>addr</I><B>,</B>
|
|
<B> unsigned long int </B><I>count</I><B>);</B>
|
|
<B>void insw(unsigned short int </B><I>port</I><B>, void *</B><I>addr</I><B>,</B>
|
|
<B> unsigned long int </B><I>count</I><B>);</B>
|
|
<B>void insl(unsigned short int </B><I>port</I><B>, void *</B><I>addr</I><B>,</B>
|
|
<B> unsigned long int </B><I>count</I><B>);</B>
|
|
<B>void outsb(unsigned short int </B><I>port</I><B>, const void *</B><I>addr</I><B>,</B>
|
|
<B> unsigned long int </B><I>count</I><B>);</B>
|
|
<B>void outsw(unsigned short int </B><I>port</I><B>, const void *</B><I>addr</I><B>,</B>
|
|
<B> unsigned long int </B><I>count</I><B>);</B>
|
|
<B>void outsl(unsigned short int </B><I>port</I><B>, const void *</B><I>addr</I><B>,</B>
|
|
<B> unsigned long int </B><I>count</I><B>);</B>
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
This family of functions is used to do low-level port input and output.
|
|
The out* functions do port output, the in* functions do port input;
|
|
the b-suffix functions are byte-width and the w-suffix functions
|
|
word-width; the _p-suffix functions pause until the I/O completes.
|
|
<P>
|
|
|
|
They are primarily designed for internal kernel use,
|
|
but can be used from user space.
|
|
|
|
|
|
|
|
<P>
|
|
|
|
You must compile with <B>-O</B> or <B>-O2</B> or similar.
|
|
The functions
|
|
are defined as inline macros, and will not be substituted in without
|
|
optimization enabled, causing unresolved references at link time.
|
|
<P>
|
|
|
|
You use
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ioperm">ioperm</A></B>(2)
|
|
|
|
or alternatively
|
|
<B><A HREF="/cgi-bin/man/man2html?2+iopl">iopl</A></B>(2)
|
|
|
|
to tell the kernel to allow the user space application to access the
|
|
I/O ports in question.
|
|
Failure to do this will cause the application
|
|
to receive a segmentation fault.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
<B>outb</B>()
|
|
|
|
and friends are hardware-specific.
|
|
The
|
|
<I>value</I>
|
|
|
|
argument is passed first and the
|
|
<I>port</I>
|
|
|
|
argument is passed second,
|
|
which is the opposite order from most DOS implementations.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+ioperm">ioperm</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+iopl">iopl</A></B>(2)
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="4"><A HREF="#lbAE">CONFORMING TO</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
<DT id="6"><A HREF="#lbAG">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:33 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|