/* * On some architectures (PPC64, IA64) function pointers * are actually only tokens to some data that then holds the * real function address. As a result, to find if a function * pointer is part of the kernel text, we need to do some * special dereferencing first. */ int func_ptr_is_kernel_text(void *ptr) { unsigned long addr; addr = (unsigned long) dereference_function_descriptor(ptr); if (core_kernel_text(addr)) return 1; return is_module_text_address(addr); }
int kernel_text_address(unsigned long addr) { if (core_kernel_text(addr)) return 1; if (is_module_text_address(addr)) return 1; return is_ftrace_trampoline(addr); }
/* * Convert a kernel address to the writable kernel text mapping. */ static unsigned long writable_address(unsigned long addr) { unsigned long ret = 0; if (core_kernel_text(addr)) ret = ktext_writable_addr(addr); else if (is_module_text_address(addr)) ret = addr; else pr_err("Unknown virtual address 0x%lx\n", addr); return ret; }
int __kernel_text_address(unsigned long addr) { if (core_kernel_text(addr)) return 1; if (is_module_text_address(addr)) return 1; /* * There might be init symbols in saved stacktraces. * Give those symbols a chance to be printed in * backtraces (such as lockdep traces). * * Since we are after the module-symbols check, there's * no danger of address overlap: */ if (init_kernel_text(addr)) return 1; return 0; }
int __kernel_text_address(unsigned long addr) { if (core_kernel_text(addr)) return 1; if (is_module_text_address(addr)) return 1; /* */ if (init_kernel_text(addr)) return 1; return 0; }
int kernel_text_address(unsigned long addr) { if (core_kernel_text(addr)) return 1; return module_text_address(addr) != NULL; }
__notrace_funcgraph int __kernel_text_address(unsigned long addr) { if (core_kernel_text(addr)) return 1; return __module_text_address(addr) != NULL; }