REPINS(K) UNIX System V REPINS(K)
Name
repins: repinsb, repinsw, repinsd, repoutsb, repoutsw,
repoutsd - reads and writes streams of device data
Syntax
#include "sys/types.h"
int
repinsb(dev_addr, kv_addr, cnt)
int dev_addr, cnt;
caddr_t kv_addr;
int
repinsw(dev_addr, kv_addr, cnt)
int dev_addr, cnt;
caddr_t kv_addr;
int
repinsd(dev_addr, kv_addr, cnt)
int dev_addr, cnt;
caddr_t kv_addr;
int
repoutsb (dev_addr, kv_addr, cnt)
int dev_addr, cnt;
caddr_t kv_addr;
int
repoutsw(dev_addr, kv_addr, cnt)
int dev_addr, cnt;
caddr_t kv_addr;
int
repoutsd(dev_addr, kv_addr, cnt)
int dev_addr, cnt;
caddr_t kv_addr;
Description
The repins routines are used to read streams of data from an
I/O port on a device to an array of size cnt whose base
begins at the kernel virtual address specified by kv_addr.
These routines are typically used for reading from disk and
SCSI devices. These 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 of size cnt whose base
begins at the kernel virtual address specified by kv_addr.
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.
Warning
If the specified read or write I/O port address is above
0x1000, call flushtlb(K) before calling a repin or repout
routine. Refer to the flushtlb manual page for more
information.
Parameters
dev_addr is the physical I/O address where reading begins.
kv_addr is 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.
The cnt parameter is one of the following values:
+ The number of bytes to be read by repinsb
+ The number of 16-bit words to be read by repinsw
+ The number of 32-bit words to be read by repinsd
For the repout routines, dev_addr is the physical I/O
address where writing begins.
kv_addr is the kernel virtual address where the data is
stored. It must be the base address of an array of size cnt
items.
The cnt parameter is one of the following values:
+ the number of bytes to be written for repoutsb
+ the number of 16-bit words to be written for
repoutsw
+ the number of 32-bit words to be written for
repoutsd
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);
See Also
flushtlb(K), inb(K), inw(K), ind(K), copyin(K)
(printed 7/19/89)