view usr/src/man/man9f/inb.9f @ 13866:040f4b0699ee

3301 lapsus calami multum Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Robert Mustacchi <rm@joyent.com>
author Joshua M. Clulow <josh@sysmgr.org>
date Thu, 25 Oct 2012 10:16:36 -0700
parents 5b2854ecc12d
children
line wrap: on
line source

'\" te
.\" Copyright (c) 2006, Sun Microsystems, Inc.
.\" 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.
.\" 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.
.\" 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]
.TH INB 9F "Oct 24, 2012"
.SH NAME
inb, inw, inl, repinsb, repinsw, repinsd \- read from an I/O port
.SH SYNOPSIS
.LP
.nf
#include <sys/ddi.h>
#include <sys/sunddi.h>

\fBunsigned char\fR \fBinb\fR(\fBint\fR \fIport\fR);
.fi

.LP
.nf
\fBunsigned short\fR \fBinw\fR(\fBint\fR
\fIport\fR);
.fi

.LP
.nf
\fBunsigned long\fR \fBinl\fR(\fBint\fR \fIport\fR);
.fi

.LP
.nf
\fBvoid\fR \fBrepinsb\fR(\fBint\fR \fIport\fR, \fBunsigned char *\fR\fIaddr\fR, \fBint\fR
\fIcount\fR);
.fi

.LP
.nf
\fBvoid\fR \fBrepinsw\fR(\fBint\fR \fIport\fR, \fBunsigned short *\fR\fIaddr\fR, \fBint\fR
\fIcount\fR);
.fi

.LP
.nf
\fBvoid\fR \fBrepinsd\fR(\fBint\fR \fIport\fR, \fBunsigned long *\fR\fIaddr\fR, \fBint\fR
\fIcount\fR);
.fi

.SH INTERFACE LEVEL
.sp
.LP
The functions described here are obsolete. For the \fBinb()\fR, \fBinw()\fR,
and \fBinl()\fR functions, use, respectively, \fBddi_get8\fR(9F),
\fBddi_get16\fR(9F), and \fBddi_get32\fR(9F) instead. For \fBrepinsb()\fR,
\fBrepinsw()\fR, and\fBrepinsl()\fR, use, respectively, \fBddi_rep_get8\fR(9F),
\fBddi_rep_get16\fR(9F), and \fBddi_rep_get32\fR(9F) instead.
.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIport\fR\fR
.ad
.RS 9n
A valid I/O port address.
.RE

.sp
.ne 2
.na
\fB\fIaddr\fR\fR
.ad
.RS 9n
The address of a buffer where the values will be stored.
.RE

.sp
.ne 2
.na
\fB\fIcount\fR\fR
.ad
.RS 9n
The number of values to be read from the I/O port.
.RE

.SH DESCRIPTION
.sp
.LP
These routines read data of various sizes from the I/O port with the address
specified by \fIport\fR.
.sp
.LP
The \fBinb()\fR, \fBinw()\fR, and \fBinl()\fR functions read 8 bits, 16 bits,
and 32 bits of data respectively, returning the resulting values.
.sp
.LP
The \fBrepinsb()\fR, \fBrepinsw()\fR, and \fBrepinsd()\fR functions read
multiple 8-bit, 16-bit, and 32-bit values, respectively. \fIcount\fR specifies
the number of values to be read. A pointer to a buffer will receive the input
data; the buffer must be long enough to hold count values of the requested
size.
.SH RETURN VALUES
.sp
.LP
The \fBinb()\fR, \fBinw()\fR, and \fBinl()\fR functions return the value that
was read from the I/O port.
.SH CONTEXT
.sp
.LP
These functions may be called from user, interrupt, or kernel context.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Architecture	x86
_
Stability Level	 Obsolete
.TE

.SH SEE ALSO
.sp
.LP
\fBisa\fR(4), \fBattributes\fR(5), \fBddi_get8\fR(9F), \fBddi_get16\fR(9F),
\fBddi_get32\fR(9F), \fBddi_rep_get8\fR(9F), \fBddi_rep_get16\fR(9F),
\fBddi_rep_get32\fR(9F), \fBoutb\fR(9F)
.sp
.LP
\fIWriting Device Drivers\fR