X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fmodule.h;h=fbf2dfc90015e69de79d452cea32e2d4f276e891;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=2709330e8684ce6ee1a65e158dd66b40caab5085;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/include/linux/module.h b/include/linux/module.h index 2709330e8..fbf2dfc90 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -225,6 +225,22 @@ struct module_kobject struct module_attribute attr[0]; }; +/* Similar stuff for section attributes. */ +#define MODULE_SECT_NAME_LEN 32 +struct module_sect_attr +{ + struct attribute attr; + char name[MODULE_SECT_NAME_LEN]; + unsigned long address; +}; + +struct module_sections +{ + struct kobject kobj; + struct module_sect_attr attrs[0]; +}; + + struct module { enum module_state state; @@ -298,6 +314,9 @@ struct module Elf_Sym *symtab; unsigned long num_symtab; char *strtab; + + /* Section attributes */ + struct module_sections *sect_attrs; #endif /* Per-cpu data. */ @@ -316,8 +335,9 @@ static inline int module_is_live(struct module *mod) return mod->state != MODULE_STATE_GOING; } -/* Is this address in a module? */ +/* Is this address in a module? (second is with no locks, for oops) */ struct module *module_text_address(unsigned long addr); +struct module *__module_text_address(unsigned long addr); /* Returns module and fills in value, defined and namebuf, or NULL if symnum out of range. */ @@ -443,6 +463,12 @@ static inline struct module *module_text_address(unsigned long addr) return NULL; } +/* Is this address in a module? (don't take a lock, we're oopsing) */ +static inline struct module *__module_text_address(unsigned long addr) +{ + return NULL; +} + /* Get/put a kernel symbol (calls should be symmetric) */ #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) #define symbol_put(x) do { } while(0)