]>
Commit | Line | Data |
---|---|---|
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 | .\" |
1dd72f9c | 5 | .\" %%%LICENSE_START(GPLv2+_DOC_FULL) |
fea681da MK |
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 | |
c715f741 MK |
22 | .\" License along with this manual; if not, see |
23 | .\" <http://www.gnu.org/licenses/>. | |
6a8d8745 | 24 | .\" %%%LICENSE_END |
fea681da | 25 | .\" |
4b8c67d9 | 26 | .TH OUTB 2 2017-09-15 "Linux" "Linux Programmer's Manual" |
fea681da MK |
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 | |
dc43bf71 MK |
31 | .SH SYNOPSIS |
32 | .nf | |
33 | .B #include <sys/io.h> | |
dbfe9c70 | 34 | .PP |
dc43bf71 MK |
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 ); | |
dbfe9c70 | 41 | .PP |
dc43bf71 MK |
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 ); | |
dbfe9c70 | 48 | .PP |
dc43bf71 MK |
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 | |
fea681da | 62 | .SH DESCRIPTION |
3b13618d | 63 | This family of functions is used to do low-level port input and output. |
fea681da MK |
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. | |
dd3568a1 | 67 | .PP |
c13182ef | 68 | They are primarily designed for internal kernel use, |
fea681da MK |
69 | but can be used from user space. |
70 | .\" , given the following information | |
71 | .\" in addition to that given in | |
72 | .\" .BR outb (9). | |
efeece04 | 73 | .PP |
3fd39c7a | 74 | You must compile with \fB\-O\fP or \fB\-O2\fP or similar. |
c13182ef | 75 | The functions |
fea681da MK |
76 | are defined as inline macros, and will not be substituted in without |
77 | optimization enabled, causing unresolved references at link time. | |
efeece04 | 78 | .PP |
fea681da MK |
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 | |
c13182ef MK |
84 | I/O ports in question. |
85 | Failure to do this will cause the application | |
fea681da | 86 | to receive a segmentation fault. |
47297adb | 87 | .SH CONFORMING TO |
60a90ecd | 88 | .BR outb () |
d19a206d | 89 | and friends are hardware-specific. |
c13182ef | 90 | The |
fea681da | 91 | .I value |
7dc020cc MK |
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. | |
47297adb | 96 | .SH SEE ALSO |
fea681da MK |
97 | .BR ioperm (2), |
98 | .BR iopl (2) |