* added 0.99 linux version
[mascara-docs.git] / i386 / linux / linux-0.99 / include / linux / module.h
blob117478c0c19e1a718dc93e9e8b8948b1074b31ac
1 /*
2 * Dynamic loading of modules into the kernel.
3 */
5 #ifndef _LINUX_MODULE_H
6 #define _LINUX_MODULE_H
8 /* values of module.state */
9 #define MOD_UNINITIALIZED 0
10 #define MOD_RUNNING 1
11 #define MOD_DELETED 2
13 /* maximum length of module name */
14 #define MOD_MAX_NAME 64
16 /* maximum length of symbol name */
17 #define SYM_MAX_NAME 60
20 struct module {
21 struct module *next;
22 char *name;
23 int size; /* size of module in pages */
24 void* addr; /* address of module */
25 int state;
26 void (*cleanup)(void); /* cleanup routine */
30 struct mod_routines {
31 int (*init)(void); /* initialization routine */
32 void (*cleanup)(void); /* cleanup routine */
36 struct kernel_sym {
37 unsigned long value; /* value of symbol */
38 char name[SYM_MAX_NAME]; /* name of symbol */
41 extern struct module *module_list;
45 * The first word of the module contains the use count.
47 #define GET_USE_COUNT(module) (* (int *) (module)->addr)
49 * define the count variable, and usage macros.
52 extern int mod_use_count_;
54 #define MOD_INC_USE_COUNT mod_use_count_++
55 #define MOD_DEC_USE_COUNT mod_use_count_--
56 #define MOD_IN_USE (mod_use_count_ != 0)
58 #endif