]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/outb.2
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man2 / outb.2
CommitLineData
fea681da
MK
1.\" Copyright (c) 1995 Paul Gortmaker
2.\" (gpg109@rsphy1.anu.edu.au)
3.\" Wed Nov 29 10:58:54 EST 1995
c13182ef 4.\"
e4a74ca8 5.\" SPDX-License-Identifier: GPL-2.0-or-later
fea681da 6.\"
4c1c5274 7.TH outb 2 (date) "Linux man-pages (unreleased)"
fea681da
MK
8.SH NAME
9outb, outw, outl, outsb, outsw, outsl,
10inb, inw, inl, insb, insw, insl,
11outb_p, outw_p, outl_p, inb_p, inw_p, inl_p \- port I/O
101def02
AC
12.SH LIBRARY
13Standard C library
8fc3b2cf 14.RI ( libc ", " \-lc )
dc43bf71
MK
15.SH SYNOPSIS
16.nf
17.B #include <sys/io.h>
dbfe9c70 18.PP
ae85f653
AC
19.BI "unsigned char inb(unsigned short " port );
20.BI "unsigned char inb_p(unsigned short " port );
21.BI "unsigned short inw(unsigned short " port );
22.BI "unsigned short inw_p(unsigned short " port );
23.BI "unsigned int inl(unsigned short " port );
24.BI "unsigned int inl_p(unsigned short " port );
dbfe9c70 25.PP
ae85f653
AC
26.BI "void outb(unsigned char " value ", unsigned short " port );
27.BI "void outb_p(unsigned char " value ", unsigned short " port );
28.BI "void outw(unsigned short " value ", unsigned short " port );
29.BI "void outw_p(unsigned short " value ", unsigned short " port );
30.BI "void outl(unsigned int " value ", unsigned short " port );
31.BI "void outl_p(unsigned int " value ", unsigned short " port );
dbfe9c70 32.PP
ae85f653
AC
33.BI "void insb(unsigned short " port ", void *" addr ,
34.BI " unsigned long " count );
35.BI "void insw(unsigned short " port ", void *" addr ,
36.BI " unsigned long " count );
37.BI "void insl(unsigned short " port ", void *" addr ,
38.BI " unsigned long " count );
39.BI "void outsb(unsigned short " port ", const void *" addr ,
40.BI " unsigned long " count );
41.BI "void outsw(unsigned short " port ", const void *" addr ,
42.BI " unsigned long " count );
43.BI "void outsl(unsigned short " port ", const void *" addr ,
44.BI " unsigned long " count );
dc43bf71 45.fi
fea681da 46.SH DESCRIPTION
3b13618d 47This family of functions is used to do low-level port input and output.
fea681da
MK
48The out* functions do port output, the in* functions do port input;
49the b-suffix functions are byte-width and the w-suffix functions
50word-width; the _p-suffix functions pause until the I/O completes.
dd3568a1 51.PP
c13182ef 52They are primarily designed for internal kernel use,
fea681da
MK
53but can be used from user space.
54.\" , given the following information
55.\" in addition to that given in
56.\" .BR outb (9).
efeece04 57.PP
3fd39c7a 58You must compile with \fB\-O\fP or \fB\-O2\fP or similar.
c13182ef 59The functions
fea681da
MK
60are defined as inline macros, and will not be substituted in without
61optimization enabled, causing unresolved references at link time.
efeece04 62.PP
fea681da
MK
63You use
64.BR ioperm (2)
65or alternatively
66.BR iopl (2)
67to tell the kernel to allow the user space application to access the
c13182ef
MK
68I/O ports in question.
69Failure to do this will cause the application
fea681da 70to receive a segmentation fault.
3113c7f3 71.SH STANDARDS
60a90ecd 72.BR outb ()
d19a206d 73and friends are hardware-specific.
c13182ef 74The
fea681da 75.I value
7dc020cc
MK
76argument is passed first and the
77.I port
78argument is passed second,
79which is the opposite order from most DOS implementations.
47297adb 80.SH SEE ALSO
fea681da
MK
81.BR ioperm (2),
82.BR iopl (2)