DeviceQuery
| Number | 0x22 |
|---|---|
| Signature | (handle, out*, buf_len) -> irq or -err |
| Group | handles |
| Since | 1.0 |
Look up a device by name or class along with its metadata (such as its IRQ). This is the gate to mapping device registers with MemMap and binding its interrupt with IrqBind.
Pitfalls
The buffer pointed to by out must be large enough to hold the device metadata. It must be of at least 33 bytes.
Arguments
| Register | Name | Description |
|---|---|---|
r0 | handle | Handle of a device capability |
r1 | out | Buffer receiving the DTB compatible string |
r2 | buf_len | Size of out, at least DEV_COMPAT_MAX |
Returns
The device's IRQ number.
Errors
| Code | Condition |
|---|---|
ERR_BADARG | handle is 0, or buf_len is 0 |
ERR_BADHANDLE | No such handle, or null device capability |
ERR_BADTYPE | Handle is not a device handle |
ERR_BADPTR | Output buffer is not writable |