The start and end address of kernel text section were got
from kallsyms_lockup_name which returns the address correspond
to symbol name exported by EXPORT_SYMBOL. So, the address can't
be got if the symbol is not exported.
This patch changes the way to get the start and end addresses of
kernel text section to reading them directly. It is possible
because they have been defined in linker script. The driver
can always get them even if the symbol is not exported.
Change-Id: Ibe3ef81ff5010db55af2db11f07cd1b82e1e6685
Signed-off-by: Junho Choi <junhosj.choi@samsung.com>
#include <linux/slab.h>
#include <linux/smc.h>
-#include <linux/kallsyms.h>
#include <asm/cacheflush.h>
#include <soc/samsung/exynos-el3_mon.h>
unsigned long ktext_end_pa = 0;
/* Get virtual addresses of kernel text */
- ktext_start_va = kallsyms_lookup_name("_text");
+ ktext_start_va = (unsigned long)_text;
if (!ktext_start_va) {
pr_err("%s: [ERROR] Kernel text start address is invalid\n",
__func__);
return -1;
}
- ktext_end_va = kallsyms_lookup_name("_etext");
+ ktext_end_va = (unsigned long)_etext;
if (!ktext_end_va) {
pr_err("%s: [ERROR] Kernel text end address is invalid\n",
__func__);