projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e14dd07
)
LoongArch: Provide kaslr_offset() to get kernel offset
author
Feiyang Chen
<chenfeiyang@loongson.cn>
Wed, 6 Sep 2023 14:53:55 +0000
(22:53 +0800)
committer
Huacai Chen
<chenhuacai@loongson.cn>
Wed, 6 Sep 2023 14:53:55 +0000
(22:53 +0800)
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>
arch/loongarch/include/asm/setup.h
patch
|
blob
|
history
diff --git
a/arch/loongarch/include/asm/setup.h
b/arch/loongarch/include/asm/setup.h
index be05c0e706a2e23d1e5c82859f02be62c82ce0b9..7c68b4365a4deffc917711b3ed8b59e1164c478f 100644
(file)
--- a/
arch/loongarch/include/asm/setup.h
+++ b/
arch/loongarch/include/asm/setup.h
@@
-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 */