Updated: April 19, 2023 |
Determine which instance of a device an offset corresponds to
#include <drvr/hwinfo.h> int hwi_find_unit (unsigned hwi_off );
Multiple instances of a device or bus may exist in the hwinfo section of the system page. The hwi_find_unit() function determines which instance of the item hwi_off is.
Note that this routine resolves all synonyms and returns the instance of a real device or bus, not the instance of a synonym name. For example, if the second instance of synonym name foo resolves to the fourth instance of the real device bar, hwi_find_unit() returns 3 (base 0 instance numbering).
The device or bus instance (or unit #, base 0) or -1 on error.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |