|
|
#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);
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.
For the repout functions, the arguments are defined as follows:
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.
/* repinsb */ char kv_addr[50]; repinsb(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./* 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);
/* 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);