2 * x86-64 linux replacement vdso.
4 * Copyright 2023 Linaro, Ltd.
6 * SPDX-License-Identifier: GPL-2.0-or-later
9 #include <asm/unistd.h>
13 .type \name, @function
14 .size \name, . - \name
22 .macro vdso_syscall name, nr
33 vdso_syscall clock_gettime, __NR_clock_gettime
34 vdso_syscall clock_getres, __NR_clock_getres
35 vdso_syscall gettimeofday, __NR_gettimeofday
36 vdso_syscall time, __NR_time
40 * There is no syscall number for this allocated on x64.
41 * We can handle this several ways:
43 * (1) Invent a syscall number for use within qemu.
44 * It should be easy enough to pick a number that
45 * is well out of the way of the kernel numbers.
47 * (2) Force the emulated cpu to support the rdtscp insn,
48 * and initialize the TSC_AUX value the appropriate value.
50 * (3) Pretend that we're always running on cpu 0.
52 * This last is the one that's implemented here, with the
53 * tiny bit of extra code to support rdtscp in place.
55 xor %ecx, %ecx /* rdtscp w/ tsc_aux = 0 */
57 /* if (cpu != NULL) *cpu = (ecx & 0xfff); */
64 /* if (node != NULL) *node = (ecx >> 12); */
78 /* TODO: Add elf note for LINUX_VERSION_CODE */