DeviceQuery

Number0x22
Signature(handle, out*, buf_len) -> irq or -err
Grouphandles
Since1.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

RegisterNameDescription
r0handleHandle of a device capability
r1outBuffer receiving the DTB compatible string
r2buf_lenSize of out, at least DEV_COMPAT_MAX

Returns

The device's IRQ number.

Errors

CodeCondition
ERR_BADARGhandle is 0, or buf_len is 0
ERR_BADHANDLENo such handle, or null device capability
ERR_BADTYPEHandle is not a device handle
ERR_BADPTROutput buffer is not writable

See also