^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2012 ARM Limited
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2014 Regents of the University of California
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2017 SiFive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifndef _ASM_RISCV_VDSO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define _ASM_RISCV_VDSO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #ifndef CONFIG_GENERIC_TIME_VSYSCALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) struct vdso_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * The VDSO symbols are mapped into Linux so we can just use regular symbol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * addressing to get their offsets in userspace. The symbols are mapped at an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * offset of 0, but since the linker must support setting weak undefined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * symbols to the absolute address 0 it also happens to support other low
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * addresses even when the code model suggests those low addresses would not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * otherwise be availiable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define VDSO_SYMBOL(base, name) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) ({ \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) extern const char __vdso_##name[]; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) (void __user *)((unsigned long)(base) + __vdso_##name); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) asmlinkage long sys_riscv_flush_icache(uintptr_t, uintptr_t, uintptr_t);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #endif /* _ASM_RISCV_VDSO_H */