2 * Dynamic loading of modules into the kernel.
5 #ifndef _LINUX_MODULE_H
6 #define _LINUX_MODULE_H
8 /* values of module.state */
9 #define MOD_UNINITIALIZED 0
13 /* maximum length of module name */
14 #define MOD_MAX_NAME 64
16 /* maximum length of symbol name */
17 #define SYM_MAX_NAME 60
23 int size
; /* size of module in pages */
24 void* addr
; /* address of module */
26 void (*cleanup
)(void); /* cleanup routine */
31 int (*init
)(void); /* initialization routine */
32 void (*cleanup
)(void); /* cleanup routine */
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)