]>
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 | .\" |
e4a74ca8 | 5 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da | 6 | .\" |
45186a5d | 7 | .TH OUTB 2 2020-11-01 "Linux man-pages (unreleased)" |
fea681da MK |
8 | .SH NAME |
9 | outb, outw, outl, outsb, outsw, outsl, | |
10 | inb, inw, inl, insb, insw, insl, | |
11 | outb_p, outw_p, outl_p, inb_p, inw_p, inl_p \- port I/O | |
101def02 AC |
12 | .SH LIBRARY |
13 | Standard 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 | 47 | This family of functions is used to do low-level port input and output. |
fea681da MK |
48 | The out* functions do port output, the in* functions do port input; |
49 | the b-suffix functions are byte-width and the w-suffix functions | |
50 | word-width; the _p-suffix functions pause until the I/O completes. | |
dd3568a1 | 51 | .PP |
c13182ef | 52 | They are primarily designed for internal kernel use, |
fea681da MK |
53 | but 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 | 58 | You must compile with \fB\-O\fP or \fB\-O2\fP or similar. |
c13182ef | 59 | The functions |
fea681da MK |
60 | are defined as inline macros, and will not be substituted in without |
61 | optimization enabled, causing unresolved references at link time. | |
efeece04 | 62 | .PP |
fea681da MK |
63 | You use |
64 | .BR ioperm (2) | |
65 | or alternatively | |
66 | .BR iopl (2) | |
67 | to tell the kernel to allow the user space application to access the | |
c13182ef MK |
68 | I/O ports in question. |
69 | Failure to do this will cause the application | |
fea681da | 70 | to receive a segmentation fault. |
3113c7f3 | 71 | .SH STANDARDS |
60a90ecd | 72 | .BR outb () |
d19a206d | 73 | and friends are hardware-specific. |
c13182ef | 74 | The |
fea681da | 75 | .I value |
7dc020cc MK |
76 | argument is passed first and the |
77 | .I port | |
78 | argument is passed second, | |
79 | which is the opposite order from most DOS implementations. | |
47297adb | 80 | .SH SEE ALSO |
fea681da MK |
81 | .BR ioperm (2), |
82 | .BR iopl (2) |