aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/module.h
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1998-10-09 23:05:45 +0000
committerPeter Wemm <peter@FreeBSD.org>1998-10-09 23:05:45 +0000
commit1f68fea8bdccadaf34e6e749a5f4805fda82b36e (patch)
treeb7adf01068ebcb9291afcd980add7c091ccb9523 /sys/sys/module.h
parent3c1cc396183dd3fbdd589e29bd1fa18f545cf2cf (diff)
downloadsrc-1f68fea8bdccadaf34e6e749a5f4805fda82b36e.tar.gz
src-1f68fea8bdccadaf34e6e749a5f4805fda82b36e.zip
A hook for storing the origin of a module, this is important when
it's being registered in sorted sysinit sequence and not in load order.
Notes
Notes: svn path=/head/; revision=40137
Diffstat (limited to 'sys/sys/module.h')
-rw-r--r--sys/sys/module.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/sys/module.h b/sys/sys/module.h
index 7553a777c258..0ec89336a3c3 100644
--- a/sys/sys/module.h
+++ b/sys/sys/module.h
@@ -23,14 +23,12 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: module.h,v 1.2 1997/10/24 05:29:07 jmg Exp $
+ * $Id: module.h,v 1.3 1998/06/10 10:57:29 dfr Exp $
*/
#ifndef _SYS_MODULE_H_
#define _SYS_MODULE_H_
-#ifdef KERNEL
-
typedef enum {
MOD_LOAD,
MOD_UNLOAD,
@@ -49,14 +47,18 @@ typedef struct moduledata {
char* name; /* module name */
modeventhand_t evhand; /* event handler */
void* priv; /* extra data */
+ void* _file; /* private; used by linker */
} moduledata_t;
+#ifdef KERNEL
+
#define DECLARE_MODULE(name, data, sub, order) \
SYSINIT(name##module, sub, order, module_register_init, &data) \
struct __hack
void module_register_init(void *data);
-int module_register(const char *name, modeventhand_t callback, void *arg);
+int module_register(const char *name, modeventhand_t callback, void *arg,
+ void *file);
module_t module_lookupbyname(const char *name);
module_t module_lookupbyid(int modid);
void module_reference(module_t mod);