|
PatchworkOS
|
Kernel module management. More...
Data Structures | |
| struct | module_event_t |
| struct | module_t |
Macros | |
| #define | MODULE_ACPI_HIDS(...) |
| Macro to define what ACPI HIDs a module can handle. | |
Enumerations | |
| enum | module_event_type_t { MODULE_EVENT_NONE = 0 , MODULE_EVENT_LOAD , MODULE_EVENT_UNLOAD } |
| Module event types. More... | |
Functions | |
| void | module_init (void) |
| Initializes the module system. | |
| uint64_t | module_event (module_event_t *event) |
| Propagates a module event to all registered modules. | |
Kernel module management.
| #define MODULE_ACPI_HIDS | ( | ... | ) |
Macro to define what ACPI HIDs a module can handle.
To define what ACPI HIDs a module can handle we define a separate section in the module's binary called .module_acpi_hids this section stores a concatenated string of all ACPI HIDs the module can handle. We dont need terminators for each string as their length is fixed depending on their prefix, we do have a null-terminator at the end of the entire list though.
Example:
| ... | A variable amount of ACPI HIDs as string literals. |
| enum module_event_type_t |
| uint64_t module_event | ( | module_event_t * | event | ) |
Propagates a module event to all registered modules.
If the event is a load or unload event, then the event's hid field will be matched against all modules' HIDs, if a match is found that module or modules will be loaded/unloaded.
| event | The event to propagate. |
0. On failure, ERR and errno is set. | void module_init | ( | void | ) |
Initializes the module system.
Definition at line 8 of file module.c.
Referenced by init_finalize().