LoongArch: Provide kaslr_offset() to get kernel offset
Provide kaslr_offset() to get the kernel offset when KASLR is enabled. Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
parent
e14dd07696
commit
b72961f847
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user