2 * aarch64 linux replacement vdso.
4 * Copyright 2023 Linaro, Ltd.
6 * SPDX-License-Identifier: GPL-2.0-or-later
9 #include <asm/unistd.h>
11 /* ??? These are in include/elf.h, which is not ready for inclusion in asm. */
12 #define NT_GNU_PROPERTY_TYPE_0 5
13 #define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000
14 #define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0)
15 #define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1)
17 #define GNU_PROPERTY_AARCH64_FEATURE_1_DEFAULT \
18 (GNU_PROPERTY_AARCH64_FEATURE_1_BTI | GNU_PROPERTY_AARCH64_FEATURE_1_PAC)
20 .section .note.gnu.property
24 .long NT_GNU_PROPERTY_TYPE_0
27 3: .long GNU_PROPERTY_AARCH64_FEATURE_1_AND
29 4: .long GNU_PROPERTY_AARCH64_FEATURE_1_DEFAULT
37 .type \name, @function
38 .size \name, . - \name
41 .macro vdso_syscall name, nr
52 vdso_syscall __kernel_gettimeofday, __NR_gettimeofday
53 vdso_syscall __kernel_clock_gettime, __NR_clock_gettime
54 vdso_syscall __kernel_clock_getres, __NR_clock_getres
60 * TODO: The kernel makes a big deal of turning off the .cfi directives,
61 * because they cause libgcc to crash, but that's because they're wrong.
63 * For now, elide the unwind info for __kernel_rt_sigreturn and rely on
64 * the libgcc fallback routine as we have always done. This requires
65 * that the code sequence used be exact.
67 * Add a nop as a spacer to ensure that unwind does not pick up the
68 * unwind info from the preceding syscall.
71 __kernel_rt_sigreturn:
72 /* No BTI C insn here -- we arrive via RET. */
73 mov x8, #__NR_rt_sigreturn
75 endf __kernel_rt_sigreturn