pio_badaddr(D3X)pio_badaddr(D3X)NAMEpio_badaddr - test for valid input bus address
pio_badaddr_val - test for valid input bus address and return value
SYNOPSIS
#include <sys/types.h>
#include <sys/ddi.h>
#include <sys/pio.h>
int pio_badaddr(piomap_t* piomap, iopaddr_t iopaddr, int size);
int pio_badaddr_val (piomap_t* piomap, iopaddr_t iopaddr, int size, void *ptr);
Arguments
piomap
A PIO map returned from pio_mapalloc(D3X).
iopaddr
The I/O bus address to be probed.
size The size in bytes to probe the I/O bus address, 1, 2, or 4.
ptr Address of a variable of the appropriate size (char, short, or int)
into which the value read is placed.
DESCRIPTION
Typically these functions are called from a I/O bus device driver's
init(D2) or edtinit(D2) function to determine whether a device is present
in the system.
Call pio_badaddr to determine whether you can read a specified bus
address. If you are also going to use the value returned from that
address, use pio_badaddr_val, thus saving one uncached read to fetch the
value.
Use pio_wbadaddr(D3X) to validate a bus address for output.
NOTES
Passing an invalid size will result in a system panic.
It is possible that the pio_badaddr_val(D3X) function may change or be
removed in the future.
These routines may not be called from an interrupt handler or from
routines that may be called from an interrupt handler.
Return Values
Both functions return 0 when the address is valid, and nonzero when it is
invalid.
See Also
pio_bcopyin(Da3x), pio_mapalloc(D3X), pio_wbadaddr(D3X).
Page 1