Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

repinsb(9F)

Name

inb, inw, inl, repinsb, repinsw, repinsd - 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);

void repinsb(int port, unsigned char *addr, int count);
void repinsw(int port, unsigned short *addr, int count);
void repinsd(int port, unsigned long *addr, int count);

Interface Level

The functions described here are obsolete. The inb(), inw(), and inl() functions are superseded by ddi_get8(9F), ddi_get16(9F), and ddi_get32(9F). The repinsb(), repinsw(), and repinsd(), functions are superseded by ddi_rep_get8(9F), ddi_rep_get16(9F), and ddi_rep_get32(9F).

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.

The repinsb(), repinsw(), and repinsd() functions read multiple 8-bit, 16-bit, and 32-bit values, respectively. count 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.

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(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Architecture
x86
Interface Stability
Obsolete

See Also

isa(5), attributes(7), ddi_get8(9F), ddi_get16(9F), ddi_get32(9F), ddi_rep_get8(9F), ddi_rep_get16(9F), ddi_rep_get32(9F), outb(9F)

Writing Device Drivers in Oracle Solaris 11.4