Commit b72961f8 authored by Feiyang Chen's avatar Feiyang Chen Committed by Huacai Chen

LoongArch: Provide kaslr_offset() to get kernel offset

Provide kaslr_offset() to get the kernel offset when KASLR is enabled.
Signed-off-by: default avatarFeiyang Chen <chenfeiyang@loongson.cn>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent e14dd076
......@@ -7,6 +7,7 @@
#define _LOONGARCH_SETUP_H
#include <linux/types.h>
#include <asm/sections.h>
#include <uapi/asm/setup.h>
#define VECSIZE 0x200
......@@ -37,4 +38,9 @@ extern void * __init relocate_kernel(void);
#endif
static inline unsigned long kaslr_offset(void)
{
return (unsigned long)&_text - VMLINUX_LOAD_ADDRESS;
}
#endif /* __SETUP_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment