xref: /illumos-gate/usr/src/man/man9f/inb.9f (revision d083fed0c91296a88878f7a468910ad5b5c888ea)
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]
INB 9F "September 12, 2020"
NAME
inb, inw, inl - read from an I/O port
SYNOPSIS
#include <sys/ddi.h>
#include <sys/sunddi.h>

unsigned char inb(int port);

unsigned short inw(int
port);

unsigned long inl(int port);
INTERFACE LEVEL
The functions described here are obsolete. For the inb(), inw(), and inl() functions, use, respectively, ddi_get8(9F), ddi_get16(9F), and ddi_get32(9F) instead.
PARAMETERS
port

A valid I/O port address.

addr

The address of a buffer where the values will be stored.

count

The number of values to be read from the I/O port.

DESCRIPTION
These routines read data of various sizes from the I/O port with the address specified by port.

The inb(), inw(), and inl() functions read 8 bits, 16 bits, and 32 bits of data respectively, returning the resulting values.

RETURN VALUES
The inb(), inw(), and inl() functions return the value that was read from the I/O port.
CONTEXT
These functions may be called from user, interrupt, or kernel context.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE
Architecture x86
Stability Level Obsolete
SEE ALSO
isa(4), attributes(5), ddi_get8(9F), ddi_get16(9F), ddi_get32(9F), outb(9F)

Writing Device Drivers