*参照元 [#u262cdcf] #backlinks *説明 [#e918a485] -パス: [[linux-4.4.1/include/linux/module.h]] -FIXME: これは何? --説明 **参考 [#b7723252] *実装 [#b21848e7] struct module { enum module_state state; - --[[linux-4.4.1/module_state]] /* Member of list of modules */ struct list_head list; - --[[linux-4.4.1/list_head]] /* Unique handle for this module */ char name[MODULE_NAME_LEN]; - --[[linux-4.4.1/MODULE_NAME_LEN]] /* Sysfs stuff. */ struct module_kobject mkobj; struct module_attribute *modinfo_attrs; const char *version; const char *srcversion; struct kobject *holders_dir; - --[[linux-4.4.1/module_kobject]] --[[linux-4.4.1/module_attribute]] --[[linux-4.4.1/kobject]] /* Exported symbols */ const struct kernel_symbol *syms; const unsigned long *crcs; unsigned int num_syms; - --[[linux-4.4.1/kernel_symbol]] /* Kernel parameters. */ #ifdef CONFIG_SYSFS struct mutex param_lock; - --[[linux-4.4.1/CONFIG_SYSFS]] --[[linux-4.4.1/mutex]] #endif struct kernel_param *kp; unsigned int num_kp; - --[[linux-4.4.1/kernel_param]] /* GPL-only exported symbols. */ unsigned int num_gpl_syms; const struct kernel_symbol *gpl_syms; const unsigned long *gpl_crcs; - --[[linux-4.4.1/kernel_symbol]] #ifdef CONFIG_UNUSED_SYMBOLS - --[[linux-4.4.1/CONFIG_UNUSED_SYMBOLS]] /* unused exported symbols. */ const struct kernel_symbol *unused_syms; const unsigned long *unused_crcs; unsigned int num_unused_syms; /* GPL-only, unused exported symbols. */ unsigned int num_unused_gpl_syms; const struct kernel_symbol *unused_gpl_syms; const unsigned long *unused_gpl_crcs; - --[[linux-4.4.1/kernel_symbol]] #endif #ifdef CONFIG_MODULE_SIG - --[[linux-4.4.1/CONFIG_MODULE_SIG]] /* Signature was verified. */ bool sig_ok; #endif bool async_probe_requested; /* symbols that will be GPL-only in the near future. */ const struct kernel_symbol *gpl_future_syms; const unsigned long *gpl_future_crcs; unsigned int num_gpl_future_syms; /* Exception table */ unsigned int num_exentries; struct exception_table_entry *extable; - --[[linux-4.4.1/exception_table_entry]] /* Startup function. */ int (*init)(void); /* * If this is non-NULL, vfree() after init() returns. * * Cacheline align here, such that: * module_init, module_core, init_size, core_size, * init_text_size, core_text_size and mtn_core::{mod,node[0]} * are on the same cacheline. */ void *module_init ____cacheline_aligned; /* Here is the actual code + data, vfree'd on unload. */ void *module_core; /* Here are the sizes of the init and core sections */ unsigned int init_size, core_size; /* The size of the executable code in each section. */ unsigned int init_text_size, core_text_size; #ifdef CONFIG_MODULES_TREE_LOOKUP - --[[linux-4.4.1/CONFIG_MODULES_TREE_LOOKUP]] /* * We want mtn_core::{mod,node[0]} to be in the same cacheline as the * above entries such that a regular lookup will only touch one * cacheline. */ struct mod_tree_node mtn_core; struct mod_tree_node mtn_init; - --[[linux-4.4.1/mod_tree_node]] #endif /* Size of RO sections of the module (text+rodata) */ unsigned int init_ro_size, core_ro_size; /* Arch-specific module values */ struct mod_arch_specific arch; - --[[linux-4.4.1/mod_arch_specific]] unsigned int taints; /* same bits as kernel:tainted */ #ifdef CONFIG_GENERIC_BUG - --[[linux-4.4.1/CONFIG_GENERIC_BUG]] /* Support for BUG */ unsigned num_bugs; struct list_head bug_list; struct bug_entry *bug_table; - --[[linux-4.4.1/bug_entry]] #endif #ifdef CONFIG_KALLSYMS - --[[linux-4.4.1/CONFIG_KALLSYMS]] /* * We keep the symbol and string tables for kallsyms. * The core_* fields below are temporary, loader-only (they * could really be discarded after module init). */ Elf_Sym *symtab, *core_symtab; unsigned int num_symtab, core_num_syms; char *strtab, *core_strtab; - --[[linux-4.4.1/Elf_Sym]] /* Section attributes */ struct module_sect_attrs *sect_attrs; /* Notes attributes */ struct module_notes_attrs *notes_attrs; - --[[linux-4.4.1/module_sect_attrs]] --[[linux-4.4.1/module_notes_attrs]] #endif /* The command line arguments (may be mangled). People like keeping pointers to this stuff */ char *args; #ifdef CONFIG_SMP - --[[linux-4.4.1/CONFIG_SMP]] /* Per-cpu data. */ void __percpu *percpu; unsigned int percpu_size; #endif #ifdef CONFIG_TRACEPOINTS - --[[linux-4.4.1/CONFIG_TRACEPOINTS]] unsigned int num_tracepoints; struct tracepoint * const *tracepoints_ptrs; - --[[linux-4.4.1/tracepoint]] #endif #ifdef HAVE_JUMP_LABEL - --[[linux-4.4.1/HAVE_JUMP_LABEL]] struct jump_entry *jump_entries; unsigned int num_jump_entries; - --[[linux-4.4.1/jump_entry]] #endif #ifdef CONFIG_TRACING - --[[linux-4.4.1/CONFIG_TRACING]] unsigned int num_trace_bprintk_fmt; const char **trace_bprintk_fmt_start; #endif #ifdef CONFIG_EVENT_TRACING - --[[linux-4.4.1/CONFIG_EVENT_TRACING]] struct trace_event_call **trace_events; unsigned int num_trace_events; struct trace_enum_map **trace_enums; unsigned int num_trace_enums; - --[[linux-4.4.1/trace_event_call]] --[[linux-4.4.1/trace_enum_map]] #endif #ifdef CONFIG_FTRACE_MCOUNT_RECORD - --[[linux-4.4.1/CONFIG_FTRACE_MCOUNT_RECORD]] unsigned int num_ftrace_callsites; unsigned long *ftrace_callsites; #endif #ifdef CONFIG_LIVEPATCH - --[[linux-4.4.1/CONFIG_LIVEPATCH]] bool klp_alive; #endif #ifdef CONFIG_MODULE_UNLOAD - --[[linux-4.4.1/CONFIG_MODULE_UNLOAD]] /* What modules depend on me? */ struct list_head source_list; /* What modules do I depend on? */ struct list_head target_list; - --[[linux-4.4.1/list_head]] /* Destruction function. */ void (*exit)(void); atomic_t refcnt; - --[[linux-4.4.1/atomic_t]] #endif #ifdef CONFIG_CONSTRUCTORS - --[[linux-4.4.1/CONFIG_CONSTRUCTORS]] /* Constructor functions. */ ctor_fn_t *ctors; unsigned int num_ctors; - --[[linux-4.4.1/ctor_fn_t]] #endif } ____cacheline_aligned; #ifndef MODULE_ARCH_INIT #define MODULE_ARCH_INIT {} - --[[linux-4.4.1/MODULE_ARCH_INIT]] #endif *コメント [#zbe5d8c7]