diff options
| author | Petr Mladek <pmladek@suse.com> | 2018-01-22 10:40:32 +0100 | 
|---|---|---|
| committer | Petr Mladek <pmladek@suse.com> | 2018-01-22 10:40:32 +0100 | 
| commit | 3ccdc5190f8df12dfafff9264e406c5496401da5 (patch) | |
| tree | ca4afea86b2ae2625125658b2e0af2e043e84017 /arch/parisc/kernel/module.c | |
| parent | 6fd78a1a99c9580da49ee8f951fdce9846256375 (diff) | |
| parent | 1df7338ac96558d5ae4c1a9dd5d1cb60fcd1bdb2 (diff) | |
Merge branch 'for-4.16-deprecate-printk-pf' into for-4.16
Diffstat (limited to 'arch/parisc/kernel/module.c')
| -rw-r--r-- | arch/parisc/kernel/module.c | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index f1a76935a314..b5b3cb00f1fb 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c @@ -66,6 +66,7 @@  #include <asm/pgtable.h>  #include <asm/unwind.h> +#include <asm/sections.h>  #if 0  #define DEBUGP printk @@ -954,3 +955,18 @@ void module_arch_cleanup(struct module *mod)  {  	deregister_unwind_table(mod);  } + +#ifdef CONFIG_64BIT +void *dereference_module_function_descriptor(struct module *mod, void *ptr) +{ +	unsigned long start_opd = (Elf64_Addr)mod->core_layout.base + +				   mod->arch.fdesc_offset; +	unsigned long end_opd = start_opd + +				mod->arch.fdesc_count * sizeof(Elf64_Fdesc); + +	if (ptr < (void *)start_opd || ptr >= (void *)end_opd) +		return ptr; + +	return dereference_function_descriptor(ptr); +} +#endif | 
