From 29e1a3b55b37f04b37e4ddd81498df731f6142f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 26 Apr 2004 17:11:56 +0000 Subject: [PATCH] Added the module_dependency structure. A module can now define modules it depends on, and they will be automatically loaded before B_MODULE_INIT is called. This information will also be evaluated by the boot loader, so that it can load all needed modules without further hacks. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7316 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/drivers/module.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/headers/os/drivers/module.h b/headers/os/drivers/module.h index a725708a47..3c8a1514b3 100644 --- a/headers/os/drivers/module.h +++ b/headers/os/drivers/module.h @@ -10,10 +10,9 @@ #include -/* module info structure - * Every module exports it - modules are identified - * by the name given in this structure. - * It exports the functions that the module support. +/* Every module exports a list of module_info structures. + * It defines the interface of the module and the name + * that is used to access the interface. */ typedef struct module_info { @@ -30,6 +29,17 @@ typedef struct module_info { #define B_KEEP_LOADED 0x00000001 +/* Use the module_dependency structure to let the + * kernel automatically load modules yet depend on + * before B_MODULE_INIT is called. + */ + +typedef struct module_dependency { + const char *name; + module_info **info; +} module_dependency; + + #ifdef __cplusplus extern "C" { #endif