badaddr(D3X)
badaddr - test for valid input bus address badaddr_val - test for valid input device address and return value
As shipped in IRIX 6.5.30. Unchanged since IRIX 6.5.
NAME badaddr - test for valid input bus address badaddr_val - test for valid input device address and return value SYNOPSIS #include <sys/types.h> #include <sys/systm.h> int badaddr(volatile void *addr, int size); int badaddr_val(volatile void *addr, int size, void *ptr); Arguments addr The VME bus address to be probed. size The size in bytes to probe the bus: 1, 2, 4, or 8. ptr A pointer to a variable of the specified size (char, short, int, or long long) into which the value read is placed. DESCRIPTION Typically these functions are called from a VME device driver's init(D2) or edtinit(D2) function to determine whether a device is present in the system. Call badaddr() to determine whether you can read the specified physical address. Call badaddr_val() when you also want to use the value read from the test address. This saves the time of another uncached memory access to read the address after it has been found to be valid. NOTES Passing an invalid size will result in a system panic. These functions may not be called from an interrupt handler or from routines that may be called from an interrupt handler. These functions are designed for systems in which device addresses have a fixed mapping into the physical memory space. Depending on the system and the hardware attachment, device addresses may be mapped dynamically. In those cases, pio_badaddr(D3X) must be used. It is possible that the badaddr_val() function may changed or removed in the future. Return Values When the addressed location is accessible, both functions return 0. Otherwise, both return 1 and badaddr_val() does not modify the variable at ptr. See Also pio_badaddr(D3X), pio_wbadaddr(D3X), wbadaddr(D3X).