MAINTAINERS: Add include/hw/xtensa/mx_pic.h to the XTFPGA machine section
[qemu/kevin.git] / linux-user / aarch64 / vdso.S
blob34d3a9ebd2d6ded89d1962dfd779756df1e94cef
1 /*
2  * aarch64 linux replacement vdso.
3  *
4  * Copyright 2023 Linaro, Ltd.
5  *
6  * SPDX-License-Identifier: GPL-2.0-or-later
7  */
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
21         .align  3
22         .long   2f - 1f
23         .long   6f - 3f
24         .long   NT_GNU_PROPERTY_TYPE_0
25 1:      .string "GNU"
26 2:      .align  3
27 3:      .long   GNU_PROPERTY_AARCH64_FEATURE_1_AND
28         .long   5f - 4f
29 4:      .long   GNU_PROPERTY_AARCH64_FEATURE_1_DEFAULT
30 5:      .align  3
33         .text
35 .macro endf name
36         .globl  \name
37         .type   \name, @function
38         .size   \name, . - \name
39 .endm
41 .macro vdso_syscall name, nr
42 \name:
43         bti     c
44         mov     x8, #\nr
45         svc     #0
46         ret
47 endf    \name
48 .endm
50         .cfi_startproc
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
56         .cfi_endproc
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.
62  *
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.
66  */
67 __kernel_rt_sigreturn:
68         /* No BTI C insn here -- we arrive via RET. */
69         mov     x8, #__NR_rt_sigreturn
70         svc     #0
71 endf    __kernel_rt_sigreturn