Find the offset in the system page of a device
#include <drvr/hwinfo.h> unsigned hwi_find_device( const char *device_name, unsigned unit );
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 |