root/include/linux/module.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Dynamic loading of modules into the kernel.
   3  */
   4 
   5 #ifndef _LINUX_MODULE_H
   6 #define _LINUX_MODULE_H
   7 
   8 /* values of module.state */
   9 #define MOD_UNINITIALIZED 0
  10 #define MOD_RUNNING 1
  11 #define MOD_DELETED 2
  12 
  13 /* maximum length of module name */
  14 #define MOD_MAX_NAME 64
  15 
  16 /* maximum length of symbol name */
  17 #define SYM_MAX_NAME 60
  18 
  19 
  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 */
  27 };
  28 
  29 
  30 struct mod_routines {
  31         int (*init)(void);              /* initialization routine */
  32         void (*cleanup)(void);          /* cleanup routine */
  33 };
  34 
  35 
  36 struct kernel_sym {
  37         unsigned long value;            /* value of symbol */
  38         char name[SYM_MAX_NAME];        /* name of symbol */
  39 };
  40 
  41 extern struct module *module_list;
  42 
  43 
  44 /*
  45  * The first word of the module contains the use count.
  46  */
  47 #define GET_USE_COUNT(module)   (* (int *) (module)->addr)
  48 /*
  49  * define the count variable, and usage macros.
  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

/* [previous][next][first][last][top][bottom][index][help] */