aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/module.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/module.h')
-rw-r--r--include/linux/module.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index c69b49abe877..d44df9b2c131 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -19,6 +19,7 @@
19#include <linux/jump_label.h> 19#include <linux/jump_label.h>
20#include <linux/export.h> 20#include <linux/export.h>
21#include <linux/rbtree_latch.h> 21#include <linux/rbtree_latch.h>
22#include <linux/error-injection.h>
22 23
23#include <linux/percpu.h> 24#include <linux/percpu.h>
24#include <asm/module.h> 25#include <asm/module.h>
@@ -475,6 +476,11 @@ struct module {
475 ctor_fn_t *ctors; 476 ctor_fn_t *ctors;
476 unsigned int num_ctors; 477 unsigned int num_ctors;
477#endif 478#endif
479
480#ifdef CONFIG_FUNCTION_ERROR_INJECTION
481 struct error_injection_entry *ei_funcs;
482 unsigned int num_ei_funcs;
483#endif
478} ____cacheline_aligned __randomize_layout; 484} ____cacheline_aligned __randomize_layout;
479#ifndef MODULE_ARCH_INIT 485#ifndef MODULE_ARCH_INIT
480#define MODULE_ARCH_INIT {} 486#define MODULE_ARCH_INIT {}
@@ -485,7 +491,7 @@ extern struct mutex module_mutex;
485/* FIXME: It'd be nice to isolate modules during init, too, so they 491/* FIXME: It'd be nice to isolate modules during init, too, so they
486 aren't used before they (may) fail. But presently too much code 492 aren't used before they (may) fail. But presently too much code
487 (IDE & SCSI) require entry into the module during init.*/ 493 (IDE & SCSI) require entry into the module during init.*/
488static inline int module_is_live(struct module *mod) 494static inline bool module_is_live(struct module *mod)
489{ 495{
490 return mod->state != MODULE_STATE_GOING; 496 return mod->state != MODULE_STATE_GOING;
491} 497}
@@ -606,6 +612,9 @@ int ref_module(struct module *a, struct module *b);
606 __mod ? __mod->name : "kernel"; \ 612 __mod ? __mod->name : "kernel"; \
607}) 613})
608 614
615/* Dereference module function descriptor */
616void *dereference_module_function_descriptor(struct module *mod, void *ptr);
617
609/* For kallsyms to ask for address resolution. namebuf should be at 618/* For kallsyms to ask for address resolution. namebuf should be at
610 * least KSYM_NAME_LEN long: a pointer to namebuf is returned if 619 * least KSYM_NAME_LEN long: a pointer to namebuf is returned if
611 * found, otherwise NULL. */ 620 * found, otherwise NULL. */
@@ -760,6 +769,13 @@ static inline bool is_module_sig_enforced(void)
760 return false; 769 return false;
761} 770}
762 771
772/* Dereference module function descriptor */
773static inline
774void *dereference_module_function_descriptor(struct module *mod, void *ptr)
775{
776 return ptr;
777}
778
763#endif /* CONFIG_MODULES */ 779#endif /* CONFIG_MODULES */
764 780
765#ifdef CONFIG_SYSFS 781#ifdef CONFIG_SYSFS
@@ -801,6 +817,15 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr,
801static inline void module_bug_cleanup(struct module *mod) {} 817static inline void module_bug_cleanup(struct module *mod) {}
802#endif /* CONFIG_GENERIC_BUG */ 818#endif /* CONFIG_GENERIC_BUG */
803 819
820#ifdef RETPOLINE
821extern bool retpoline_module_ok(bool has_retpoline);
822#else
823static inline bool retpoline_module_ok(bool has_retpoline)
824{
825 return true;
826}
827#endif
828
804#ifdef CONFIG_MODULE_SIG 829#ifdef CONFIG_MODULE_SIG
805static inline bool module_sig_ok(struct module *module) 830static inline bool module_sig_ok(struct module *module)
806{ 831{