37#include <kernel/device.h>
41#include <utils/compiler.h>
112typedef void (*driver_init_t)(void);
123#define DECLARE_DRIVER(_name, _driver, _driver_register) \
124 static void init_driver_##_name(void) \
126 _driver_register(_driver); \
129 SECTION(".data.driver.init") \
131 static driver_init_t __##_name##_driver_init = init_driver_##_name;
void driver_register(driver_t *driver)
Register a new driver.
Definition: driver.c:45
void driver_load_drivers(void)
Load all builtin drivers.
Definition: driver.c:34
driver_t * driver_find_match(device_t *)
Retreive the driver that matches the given arguments.
Definition: driver.c:68
Vector table of the common operations used to control drivers.
Definition: driver.h:85
error_t(* probe)(device_t *)
Bind the driver to a device.
Definition: driver.h:87
bool(* match)(const driver_t *, const device_t *)
Check if the driver should be used for this device This function should be the same for each driver o...
Definition: driver.h:91
The basic device driver structure.
Definition: driver.h:77
struct device_driver::driver_operations operations
Vector table of driver control operations.
const char * name
The name of the driver.
Definition: driver.h:80
Represents a device inside the kernel.
Definition: device.h:78
Intrusive doubly-linked list node.
Definition: linked_list.h:27