|
ginnOS
The reference: libc, the libraries and the kernel
|
flat device registry. More...
Macros | |
| #define | DEVICE_MAX 32 |
Functions | |
| void | device_registry_init (void) |
| reset the device registry. | |
| bool | device_register (device_t *dev) |
| register a device. | |
| uint32_t | device_count (void) |
| number of currently registered devices. | |
| device_t * | device_get (uint32_t index) |
| get a registered device by index (0 . | |
| device_t * | device_find (const char *name) |
| find a registered device by name. | |
flat device registry.
a fixed array of device pointers, enough for the handful of devices ginnOS has today. drivers keep their own device_t storage; the registry only holds references so it can enumerate and look them up by name.
| #define DEVICE_MAX 32 |
| void device_registry_init | ( | void | ) |
reset the device registry.
call once during early boot.
register a device.
the device_t is owned by the caller and must outlive its registration (drivers use static or long-lived storage).
| dev | the device to add. |
| uint32_t device_count | ( | void | ) |
number of currently registered devices.
get a registered device by index (0 .
. device_count()-1).
| device_t * device_find | ( | const char * | name | ) |
find a registered device by name.