Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / inb.9f
blob61fc3c14445989c3d1ceb0553d518a5521c101d3
1 '\" te
2 .\" Copyright (c) 2006, Sun Microsystems, Inc.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH INB 9F "Oct 24, 2012"
7 .SH NAME
8 inb, inw, inl, repinsb, repinsw, repinsd \- read from an I/O port
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/ddi.h>
13 #include <sys/sunddi.h>
15 \fBunsigned char\fR \fBinb\fR(\fBint\fR \fIport\fR);
16 .fi
18 .LP
19 .nf
20 \fBunsigned short\fR \fBinw\fR(\fBint\fR
21 \fIport\fR);
22 .fi
24 .LP
25 .nf
26 \fBunsigned long\fR \fBinl\fR(\fBint\fR \fIport\fR);
27 .fi
29 .LP
30 .nf
31 \fBvoid\fR \fBrepinsb\fR(\fBint\fR \fIport\fR, \fBunsigned char *\fR\fIaddr\fR, \fBint\fR
32 \fIcount\fR);
33 .fi
35 .LP
36 .nf
37 \fBvoid\fR \fBrepinsw\fR(\fBint\fR \fIport\fR, \fBunsigned short *\fR\fIaddr\fR, \fBint\fR
38 \fIcount\fR);
39 .fi
41 .LP
42 .nf
43 \fBvoid\fR \fBrepinsd\fR(\fBint\fR \fIport\fR, \fBunsigned long *\fR\fIaddr\fR, \fBint\fR
44 \fIcount\fR);
45 .fi
47 .SH INTERFACE LEVEL
48 .sp
49 .LP
50 The functions described here are obsolete. For the \fBinb()\fR, \fBinw()\fR,
51 and \fBinl()\fR functions, use, respectively, \fBddi_get8\fR(9F),
52 \fBddi_get16\fR(9F), and \fBddi_get32\fR(9F) instead. For \fBrepinsb()\fR,
53 \fBrepinsw()\fR, and\fBrepinsl()\fR, use, respectively, \fBddi_rep_get8\fR(9F),
54 \fBddi_rep_get16\fR(9F), and \fBddi_rep_get32\fR(9F) instead.
55 .SH PARAMETERS
56 .sp
57 .ne 2
58 .na
59 \fB\fIport\fR\fR
60 .ad
61 .RS 9n
62 A valid I/O port address.
63 .RE
65 .sp
66 .ne 2
67 .na
68 \fB\fIaddr\fR\fR
69 .ad
70 .RS 9n
71 The address of a buffer where the values will be stored.
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fB\fIcount\fR\fR
78 .ad
79 .RS 9n
80 The number of values to be read from the I/O port.
81 .RE
83 .SH DESCRIPTION
84 .sp
85 .LP
86 These routines read data of various sizes from the I/O port with the address
87 specified by \fIport\fR.
88 .sp
89 .LP
90 The \fBinb()\fR, \fBinw()\fR, and \fBinl()\fR functions read 8 bits, 16 bits,
91 and 32 bits of data respectively, returning the resulting values.
92 .sp
93 .LP
94 The \fBrepinsb()\fR, \fBrepinsw()\fR, and \fBrepinsd()\fR functions read
95 multiple 8-bit, 16-bit, and 32-bit values, respectively. \fIcount\fR specifies
96 the number of values to be read. A pointer to a buffer will receive the input
97 data; the buffer must be long enough to hold count values of the requested
98 size.
99 .SH RETURN VALUES
102 The \fBinb()\fR, \fBinw()\fR, and \fBinl()\fR functions return the value that
103 was read from the I/O port.
104 .SH CONTEXT
107 These functions may be called from user, interrupt, or kernel context.
108 .SH ATTRIBUTES
111 See \fBattributes\fR(5) for descriptions of the following attributes:
116 box;
117 c | c
118 l | l .
119 ATTRIBUTE TYPE  ATTRIBUTE VALUE
121 Architecture    x86
123 Stability Level  Obsolete
126 .SH SEE ALSO
129 \fBisa\fR(4), \fBattributes\fR(5), \fBddi_get8\fR(9F), \fBddi_get16\fR(9F),
130 \fBddi_get32\fR(9F), \fBddi_rep_get8\fR(9F), \fBddi_rep_get16\fR(9F),
131 \fBddi_rep_get32\fR(9F), \fBoutb\fR(9F)
134 \fIWriting Device Drivers\fR