DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

repins(D3oddi)


repins: repinsb, repinsw, repinsd, repoutsb, repoutsw, repoutsd -- read and write streams of device data

Synopsis

#include <sys/types.h>

void repinsb(int dev_addr, caddr_t kv_addr, int cnt);

void repinsw(int dev_addr, caddr_t kv_addr, int cnt);

void repinsd(int dev_addr, caddr_t kv_addr, int cnt);

void repoutsb(int dev_addr, caddr_t kv_addr, int cnt);

void repoutsw(int dev_addr, caddr_t kv_addr, int cnt);

void repoutsd(int dev_addr, caddr_t kv_addr, int cnt);

Description

The repins functions are used to read streams of data from an I/O port on a device to a specified kernel virutal address. These routines are typically used for reading from disk and SCSI devices. The routines assume that the virtual address specified is a valid kernel address currently in RAM.

repinsb( ) reads a stream of bytes from an I/O address to a kernel virtual address.

repinsw( ) reads a stream of 16-bit words from an I/O address to a kernel virtual address.

repinsd( ) reads a stream of 32-bit words from an I/O address to a kernel virtual address.

The repout routines are used to write streams of data to an I/O port on a device from an array whose base begins at the specified kernel virtual address. These routines are typically used for writing to disk and SCSI devices. These routines assume that the virtual address specified is a valid kernel address currently in RAM.

repoutsb( ) writes a stream of bytes to an I/O address from a kernel virtual address.

repoutsw( ) writes a stream of 16-bit words to an I/O address from a kernel virtual address.

repoutsd( ) writes a stream of 32-bit words to an I/O address from a kernel virtual address.

Arguments

For the repins functions, the arguments are defined as follows:

dev_addr
The physical I/O address where reading begins.

kv_addr
The kernel virtual address where the data will be stored. It must be the base address of an array large enough to hold cnt items.

cnt
One of the following:

For the repout functions, the arguments are defined as follows:


dev_addr
The physical I/O address where writing begins.

kv_addr
The kernel virtual address where the data is stored. It must be the base address of an array of size cnt items.

cnt
One of the following:

Return values

None.

Usage

Context and synchronization

All contexts.

Hardware applicability

All Intel IA-32 compatible platforms

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

The repinsb(D3), repinsd(D3), repinsw(D3), repoutsb(D3), repoutsd(D3), and repoutsw(D3) functions are essentially the same functions for SVR5 DDI drivers, although note that the casting of the arguments is different.

DOS systems often issue this function from user-level code. ``Porting DOS inb and outb functionality'' in HDK Technical Reference provides information about how to port such code to SCO OpenServer systems.

References

inb(D3oddi), ind(D3oddi), inw(D3oddi)

Examples

The following three examples demonstrate how to use the repins routines. In each case the variable dev_addr would need to be assigned an appropriate value (I/O address) before being used as a parameter. In these examples kv_addr specifies an array of memory declared locally by the device driver but it could be any kernel virtual address.
   /* repinsb */
   char kv_addr[50];
   repinsb(dev_addr, (caddr_t) kv_addr, 50);
   

/* repinsw */ short int kv_addr[50]; repinsw(dev_addr, (caddr_t) kv_addr, 50);

/* repinsd */ int kv_addr[50]; repinsd(dev_addr, (caddr_t) kv_addr, 50);

The following three examples demonstrate how to use the repout routines. In each case the variable dev_addr would need to be assigned an appropriate value (I/O address) before being used as a parameter. In these examples kv_addr specifies an array of memory declared locally by the device driver, but note that kv_addr can be any kernel virtual address.
   /* repoutsb */
   char kv_addr[50];
   repoutsb(dev_addr, (caddr_t) kv_addr, 50);
   

/* repoutsw */ short int kv_addr[50]; repoutsw(dev_addr, (caddr_t) kv_addr, 50);

/* repoutsd */ int kv_addr[50]; repoutsd(dev_addr, (caddr_t) kv_addr, 50);


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005