 |
Index for Section 9 |
|
 |
Alphabetical listing for I |
|
 |
Bottom of page |
|
io_copyio(9r)
NAME
io_copyio - General: Copies data from bus address space to bus address
space
SYNOPSIS
int io_copyio(
io_handle_t srcaddr,
io_handle_t destaddr,
u_long byte_count );
ARGUMENTS
srcaddr
Specifies an I/O handle that you can use to reference a device register
or memory located in bus address space (either I/O space or memory
space). For io_copyio, this I/O handle identifies the location in bus
address space where the copy originates. You can perform standard C
mathematical operations (addition and subtraction only) on the I/O
handle. For example, you can add an offset to or subtract an offset
from the I/O handle.
destaddr
Specifies an I/O handle that you can use to reference a device register
or memory located in bus address space (either I/O space or memory
space). In this case, the I/O handle identifies the location in bus
address space where the copy occurs.
byte_count
Specifies the number of bytes in the data block to be copied. The
interface assumes that the buffer associated with the data block is
physically contiguous.
DESCRIPTION
The io_copyio interface copies data from one location in bus address space
to another location in bus address space. The I/O handles you pass to
srcaddr and destaddr identify the locations in bus address space where the
copy originates and where the copy occurs. The io_copyio interface assumes
no alignment of data associated with srcaddr and destaddr.
NOTES
The io_copyio interface is a generic interface that maps to a bus- and
machine-specific interface that actually performs the copy of data from one
location in bus address space to another location in bus address space.
Using io_copyio to perform the copy operation makes the device driver more
portable across different CPU architectures and different CPU types within
the same architecture.
CAUTIONS
The I/O handles that you pass to the srcaddr and destaddr arguments of the
io_copyio interface must be I/O handles that reference addresses residing
in sparse space. All Alpha CPUs support sparse space. As a result, all bus
configuration code should supply an I/O handle that references bus address
space.
If you pass I/O handles to the srcaddr and destaddr arguments that
reference addresses residing in some other space (for example, dense space)
the results of the copy operation are unpredictable.
Tru64 UNIX provides the following interfaces that allow device drivers to
perform copy operations and zero blocks of memory on addresses that reside
in dense space:
· bcopy
Copies a series of bytes with a specified limit
· blkclr and bzero
Zeros a block of memory
· copyin
Copies data from a user address space to a kernel address space
· copyinstr
Copies a null-terminated string from a user address space to a kernel
address space
· copyout
Copies data from a kernel address space to a user address space
· copyoutstr
Copies a null-terminated string from a kernel address space to a user
address space
EXAMPLE
See Writing Device Drivers: Tutorial for a code example of the io_copyio
interface.
RETURN VALUES
Upon successful completion, io_copyio returns IOA_OKAY. It returns the
value -1 on failure.
SEE ALSO
Kernel Interfaces: io_copyin(9r), io_copyout(9r)
 |
Index for Section 9 |
|
 |
Alphabetical listing for I |
|
 |
Top of page |
|