Find the offset in the system page of a device
#include <drvr/hwinfo.h> unsigned hwi_find_device( const char *device_name, unsigned unit );
libdrvr
Use the -l drvr option to qcc to link against this library.
If the unit instance of device_name has been added to the hwinfo section of the syspage, hwi_find_device() returns its offset. This function ensures that the device_name found is in fact a device.
If the same device (by name) exists on multiple buses, you can identify the bus on which each device instance resides with hwi_find_devicebus().
The hwi_find_device() function is basically a wrapper hwi_find_item() that allows for a specific item instance to be returned. It differs from hwi_find_item() in that it resolves (all) synonym names (aliases) to a real device.
The hwinfo section offset, or HWI_NULL_OFF if the device instance doesn't exist.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
hwi_find(), hwi_find_bus(), hwi_find_devicebus(), hwi_find_num_units(), hwi_find_unit(), hwi_tag_find(), hwiattr_get(), hwiattr_get_*(), hwitag_find_busattr(), hwitag_find_clkfreq(), hwitag_find_errata(), hwitag_find_ivec(), hwitag_find_nicaddr(), hwitag_find_phyaddr()