[PATCH v2 03/18] RISC-V: Add support for 32-bit vDSO calls
Maciej W. Rozycki
macro@wdc.com
Wed Jul 8 01:01:31 GMT 2020
On Wed, 3 Jun 2020, Alistair Francis via Libc-alpha wrote:
> diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
> index aa61e8b04d..9f6ed2001b 100644
> --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
> @@ -182,14 +182,21 @@
>
> #ifndef __ASSEMBLER__
>
> -# define VDSO_NAME "LINUX_4.15"
> -# define VDSO_HASH 182943605
> +# if __riscv_xlen == 32
Same note on __riscv_xlen vs __WORDSIZE as with 02/18.
Also given it is a two-way conditional we can choose which leg is first
and I'd make that the RV64 variant, as the first to be there and more
developed, as evident here.
> /* List of system calls which are supported as vsyscalls. */
> -# define HAVE_CLOCK_GETRES64_VSYSCALL "__vdso_clock_getres"
> -# define HAVE_CLOCK_GETTIME64_VSYSCALL "__vdso_clock_gettime"
> -# define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday"
> -# define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"
> +# else
> +# define VDSO_NAME "LINUX_4.15"
> +# define VDSO_HASH 182943605
> +
> +/* List of system calls which are supported as vsyscalls. */
> +# define HAVE_CLOCK_GETRES64_VSYSCALL "__vdso_clock_getres"
> +# define HAVE_CLOCK_GETTIME64_VSYSCALL "__vdso_clock_gettime"
> +# define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday"
> +# define HAVE_GETCPU_VSYSCALL "__vdso_getcpu"
> +# endif
Also "__vdso_getcpu" does get exported unlike the time calls with RV32
AFAICT:
# Symbols present in the vdso
vdso-syms = rt_sigreturn
ifdef CONFIG_64BIT
vdso-syms += vgettimeofday
endif
vdso-syms += getcpu
vdso-syms += flush_icache
so it should be included (and placed outside the conditional, unlike with
an earlier version of this change). Then the change description (and
preferably a comment as well) ought to explain why the remaining ones have
been left out for RV32.
Maciej
More information about the Libc-alpha
mailing list