1
2
3
4
5 #ifndef _LINUX_MODULE_H
6 #define _LINUX_MODULE_H
7
8
9 #define MOD_UNINITIALIZED 0
10 #define MOD_RUNNING 1
11 #define MOD_DELETED 2
12
13
14 #define MOD_MAX_NAME 64
15
16
17 #define SYM_MAX_NAME 60
18
19
20 struct module {
21 struct module *next;
22 char *name;
23 int size;
24 void* addr;
25 int state;
26 void (*cleanup)(void);
27 };
28
29
30 struct mod_routines {
31 int (*init)(void);
32 void (*cleanup)(void);
33 };
34
35
36 struct kernel_sym {
37 unsigned long value;
38 char name[SYM_MAX_NAME];
39 };
40
41 extern struct module *module_list;
42
43
44
45
46
47 #define GET_USE_COUNT(module) (* (int *) (module)->addr)
48
49
50
51
52 extern int mod_use_count_;
53
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)
57
58 #endif