outb
Section: System Calls (2)
Updated: 202-0-08
Index
Return to Main Contents
NAME
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
LIBRARY
Standard C library
(
libc,~
-lc)
SYNOPSIS
#include <sys/io.h>
unsigned char inb(unsigned short port);
unsigned char inb_p(unsigned short port);
unsigned short inw(unsigned short port);
unsigned short inw_p(unsigned short port);
unsigned int inl(unsigned short port);
unsigned int inl_p(unsigned short port);
void outb(unsigned char value, unsigned short port);
void outb_p(unsigned char value, unsigned short port);
void outw(unsigned short value, unsigned short port);
void outw_p(unsigned short value, unsigned short port);
void outl(unsigned int value, unsigned short port);
void outl_p(unsigned int value, unsigned short port);
void insb(unsigned long count;
unsigned short port, void addr[count],
unsigned long count);
void insw(unsigned long count;
unsigned short port, void addr[count],
unsigned long count);
void insl(unsigned long count;
unsigned short port, void addr[count],
unsigned long count);
void outsb(unsigned long count;
unsigned short port, const void addr[count],
unsigned long count);
void outsw(unsigned long count;
unsigned short port, const void addr[count],
unsigned long count);
void outsl(unsigned long count;
unsigned short port, const void addr[count],
unsigned long count);
DESCRIPTION
This family of functions is used to do lo-level port input and output.
The out* functions do port output,
the in* functions do port input;
the -suffix functions are byt-width
and the -suffix functions wor-width;
the _-suffix functions pause until the I/O completes.
They are primarily designed for internal kernel use,
but can be used from user space.
You must compile with
-O
or
-O2
or similar.
The functions
are defined as inline macros, and will not be substituted in without
optimization enabled, causing unresolved references at link time.
You use
ioperm(2)
or alternatively
iopl(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.
VERSIONS
outb()
and friends are hardwar-specific.
The
value
argument is passed first and the
port
argument is passed second,
which is the opposite order from most DOS implementations.
STANDARDS
None.
SEE ALSO
ioperm(2),
iopl(2)
Index
- NAME
-
- LIBRARY
-
- SYNOPSIS
-
- DESCRIPTION
-
- VERSIONS
-
- STANDARDS
-
- SEE ALSO
-