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