2002-09-23 06:36:51 +04:00
|
|
|
/*
|
2008-07-03 15:52:36 +04:00
|
|
|
* Copyright 2005-2008, Axel Dörfler, axeld@pinc-software.de.
|
2005-01-18 05:34:00 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-09-23 06:36:51 +04:00
|
|
|
#ifndef _KERNEL_MODULE_H
|
|
|
|
#define _KERNEL_MODULE_H
|
|
|
|
|
2005-01-18 05:34:00 +03:00
|
|
|
|
2002-09-23 06:36:51 +04:00
|
|
|
#include <drivers/module.h>
|
|
|
|
#include <kernel.h>
|
|
|
|
|
2003-05-03 20:03:26 +04:00
|
|
|
struct kernel_args;
|
|
|
|
|
2005-01-18 05:34:00 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2008-07-03 15:52:36 +04:00
|
|
|
// C++ only part
|
|
|
|
|
|
|
|
class NotificationListener;
|
|
|
|
|
|
|
|
extern status_t start_watching_modules(const char *prefix,
|
|
|
|
NotificationListener &listener);
|
|
|
|
extern status_t stop_watching_modules(const char *prefix,
|
|
|
|
NotificationListener &listener);
|
|
|
|
|
|
|
|
|
2005-01-18 05:34:00 +03:00
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern status_t unload_module(const char *path);
|
|
|
|
extern status_t load_module(const char *path, module_info ***_modules);
|
|
|
|
|
2004-04-27 01:04:06 +04:00
|
|
|
extern status_t module_init(struct kernel_args *args);
|
2008-08-04 17:26:13 +04:00
|
|
|
extern status_t module_init_post_threads(void);
|
* Call module_init_post_boot_device() right after the boot volume has
been mounted, before anyone could try to load any modules from it.
Also pass it a flag whether the boot volume is where the boot loader
pre-loaded the modules from.
* module_init_post_boot_device() changes the pre-loaded module image
paths to normalized boot volume paths, now. Got rid of the code in
register_preloaded_module_image() which tried something like this.
* Changed module image ref counting. A referenced module has single
reference to its image, which is released when the module becomes
unreferenced.
* get_module() for a reference module will not try to re-get and re-set
the module's image anymore. That could lead to a similar module (from
different paths) being loaded at the same time. A module from a new
file can only be loaded when the old one has been put completely.
* Simplified B_KEEP_ALIVE module handling a bit. When the module is
initialized, we add another reference, which we'll never free. Thus
the module remains loaded without special handling. Removed
module_image::keep_loaded. A B_KEEP_ALIVE module remains referenced
and thus its image remains referenced, too.
* Removed module::file, a cached path to the module's image. An
optimization that wouldn't work with multiple root directories for
modules (/boot/beos/..., /boot/common/...) or when module files were
moved. get_module() does now always search the image file, when the
module is still unreferenced. This should be a bit slower than before,
but I didn't notice any difference in VMware at least. If it turns out
to be a problem we could introduce a more intelligent cache that stays
up to date by using node monitoring.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27752 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-27 03:59:53 +04:00
|
|
|
extern status_t module_init_post_boot_device(bool bootingFromBootLoaderVolume);
|
2005-01-18 05:34:00 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2002-09-23 06:36:51 +04:00
|
|
|
|
|
|
|
#endif /* _KRENEL_MODULE_H */
|