summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/vdso.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv/include/asm/vdso.h')
-rw-r--r--arch/riscv/include/asm/vdso.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/arch/riscv/include/asm/vdso.h b/arch/riscv/include/asm/vdso.h
index f891478829a5..35bf830a5576 100644
--- a/arch/riscv/include/asm/vdso.h
+++ b/arch/riscv/include/asm/vdso.h
@@ -14,13 +14,23 @@
*/
#ifdef CONFIG_MMU
-#define __VVAR_PAGES 2
+#define __VDSO_PAGES 4
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
#include <generated/vdso-offsets.h>
+#ifdef CONFIG_RISCV_USER_CFI
+#include <generated/vdso-cfi-offsets.h>
+#endif
+#ifdef CONFIG_RISCV_USER_CFI
#define VDSO_SYMBOL(base, name) \
- (void __user *)((unsigned long)(base) + __vdso_##name##_offset)
+ (riscv_has_extension_unlikely(RISCV_ISA_EXT_ZIMOP) ? \
+ (void __user *)((unsigned long)(base) + __vdso_##name##_cfi_offset) : \
+ (void __user *)((unsigned long)(base) + __vdso_##name##_offset))
+#else
+#define VDSO_SYMBOL(base, name) \
+ ((void __user *)((unsigned long)(base) + __vdso_##name##_offset))
+#endif
#ifdef CONFIG_COMPAT
#include <generated/compat_vdso-offsets.h>
@@ -33,8 +43,9 @@ extern char compat_vdso_start[], compat_vdso_end[];
#endif /* CONFIG_COMPAT */
extern char vdso_start[], vdso_end[];
+extern char vdso_cfi_start[], vdso_cfi_end[];
-#endif /* !__ASSEMBLY__ */
+#endif /* !__ASSEMBLER__ */
#endif /* CONFIG_MMU */