1 .\" Copyright (c) 1995 Paul Gortmaker
2 .\" (gpg109@rsphy1.anu.edu.au)
3 .\" Wed Nov 29 10:58:54 EST 1995
5 .\" SPDX-License-Identifier: GPL-2.0-or-later
7 .TH OUTB 2 2022-09-09 "Linux man-pages (unreleased)"
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
14 .RI ( libc ", " \-lc )
17 .B #include <sys/io.h>
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 );
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 );
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 );
47 This family of functions is used to do low-level port input and output.
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.
52 They are primarily designed for internal kernel use,
53 but can be used from user space.
54 .\" , given the following information
55 .\" in addition to that given in
58 You must compile with \fB\-O\fP or \fB\-O2\fP or similar.
60 are defined as inline macros, and will not be substituted in without
61 optimization enabled, causing unresolved references at link time.
67 to tell the kernel to allow the user space application to access the
68 I/O ports in question.
69 Failure to do this will cause the application
70 to receive a segmentation fault.
73 and friends are hardware-specific.
76 argument is passed first and the
78 argument is passed second,
79 which is the opposite order from most DOS implementations.