OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man2 / outb.2
1 .\" Copyright (c) 1995 Paul Gortmaker
2 .\" (gpg109@rsphy1.anu.edu.au)
3 .\" Wed Nov 29 10:58:54 EST 1995
4 .\"
5 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
6 .\" This is free documentation; you can redistribute it and/or
7 .\" modify it under the terms of the GNU General Public License as
8 .\" published by the Free Software Foundation; either version 2 of
9 .\" the License, or (at your option) any later version.
10 .\"
11 .\" The GNU General Public License's references to "object code"
12 .\" and "executables" are to be interpreted as the output of any
13 .\" document formatting or typesetting system, including
14 .\" intermediate and printed output.
15 .\"
16 .\" This manual is distributed in the hope that it will be useful,
17 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
18 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 .\" GNU General Public License for more details.
20 .\"
21 .\" You should have received a copy of the GNU General Public
22 .\" License along with this manual; if not, see
23 .\" <http://www.gnu.org/licenses/>.
24 .\" %%%LICENSE_END
25 .\"
26 .TH OUTB 2 2012-12-31 "Linux" "Linux Programmer's Manual"
27 .SH NAME
28 outb, outw, outl, outsb, outsw, outsl,
29 inb, inw, inl, insb, insw, insl,
30 outb_p, outw_p, outl_p, inb_p, inw_p, inl_p \- port I/O
31 .SH SYNOPSIS
32 .nf
33 .B #include <sys/io.h>
34
35 .BI "unsigned char inb(unsigned short int " port );
36 .BI "unsigned char inb_p(unsigned short int " port );
37 .BI "unsigned short int inw(unsigned short int " port );
38 .BI "unsigned short int inw_p(unsigned short int " port );
39 .BI "unsigned int inl(unsigned short int " port );
40 .BI "unsigned int inl_p(unsigned short int " port );
41
42 .BI "void outb(unsigned char " value ", unsigned short int " port );
43 .BI "void outb_p(unsigned char " value ", unsigned short int " port );
44 .BI "void outw(unsigned short int " value ", unsigned short int " port );
45 .BI "void outw_p(unsigned short int " value ", unsigned short int " port );
46 .BI "void outl(unsigned int " value ", unsigned short int " port );
47 .BI "void outl_p(unsigned int " value ", unsigned short int " port );
48
49 .BI "void insb(unsigned short int " port ", void *" addr ,
50 .BI "           unsigned long int " count );
51 .BI "void insw(unsigned short int " port ", void *" addr ,
52 .BI "           unsigned long int " count );
53 .BI "void insl(unsigned short int " port ", void *" addr ,
54 .BI "           unsigned long int " count );
55 .BI "void outsb(unsigned short int " port ", const void *" addr ,
56 .BI "           unsigned long int " count );
57 .BI "void outsw(unsigned short int " port ", const void *" addr ,
58 .BI "           unsigned long int " count );
59 .BI "void outsl(unsigned short int " port ", const void *" addr ,
60 .BI "           unsigned long int " count );
61 .fi
62 .SH DESCRIPTION
63 This family of functions is used to do low-level port input and output.
64 The out* functions do port output, the in* functions do port input;
65 the b-suffix functions are byte-width and the w-suffix functions
66 word-width; the _p-suffix functions pause until the I/O completes.
67 .LP
68 They are primarily designed for internal kernel use,
69 but can be used from user space.
70 .\" , given the following information
71 .\" in addition to that given in
72 .\" .BR outb (9).
73
74 You must compile with \fB\-O\fP or \fB\-O2\fP or similar.
75 The functions
76 are defined as inline macros, and will not be substituted in without
77 optimization enabled, causing unresolved references at link time.
78
79 You use
80 .BR ioperm (2)
81 or alternatively
82 .BR iopl (2)
83 to tell the kernel to allow the user space application to access the
84 I/O ports in question.
85 Failure to do this will cause the application
86 to receive a segmentation fault.
87 .SH CONFORMING TO
88 .BR outb ()
89 and friends are hardware-specific.
90 The
91 .I value
92 argument is passed first and the
93 .I port
94 argument is passed second,
95 which is the opposite order from most DOS implementations.
96 .SH SEE ALSO
97 .BR ioperm (2),
98 .BR iopl (2)
99 .SH COLOPHON
100 This page is part of release 3.68 of the Linux
101 .I man-pages
102 project.
103 A description of the project,
104 information about reporting bugs,
105 and the latest version of this page,
106 can be found at
107 \%http://www.kernel.org/doc/man\-pages/.