[v3,04/19] RISC-V: Add support for 32-bit vDSO calls

Message ID 50619acf4344de8022a28f34cd04c36eff6873ae.1594568655.git.alistair.francis@wdc.com
State Committed
Headers
Series glibc port for 32-bit RISC-V (RV32) |

Commit Message

Alistair Francis July 12, 2020, 3:47 p.m. UTC
  ---
 sysdeps/unix/sysv/linux/riscv/sysdep.h | 27 ++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)
  

Comments

Maciej W. Rozycki July 16, 2020, 12:12 a.m. UTC | #1
On Sun, 12 Jul 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 62a9551f50..bf26379479 100644
> --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
> @@ -136,14 +136,25 @@
>  
>  #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"
> +# if __WORDSIZE == 64
> +#  define VDSO_NAME  "LINUX_4.15"
> +#  define VDSO_HASH  182943605
> +
> +/* List of system calls which are supported as vsyscalls only
> +   for RV64.  */
> +#  define HAVE_CLOCK_GETRES64_VSYSCALL   "__vdso_clock_getres"
> +#  define HAVE_CLOCK_GETTIME64_VSYSCALL  "__vdso_clock_gettime"
> +#  define HAVE_GETTIMEOFDAY_VSYSCALL     "__vdso_gettimeofday"
> +# else
> +#  define VDSO_NAME  "LINUX_5.4"
> +#  define VDSO_HASH  61765876
> +
> +/* RV32 does not support the gettime VDSO syscalls.  */
> +# endif
> +
> +/* List of system calls which are supported as vsyscalls (for RV32 and
> +   RV64).  */
> +#  define HAVE_GETCPU_VSYSCALL           "__vdso_getcpu"
    ^^
 Extraneous space here.

 Please use tabs rather than spaces between the LHS and the RHS 
throughout.  Otherwise OK.  Thanks for adding the comments.

  Maciej
  

Patch

diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
index 62a9551f50..bf26379479 100644
--- a/sysdeps/unix/sysv/linux/riscv/sysdep.h
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
@@ -136,14 +136,25 @@ 
 
 #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"
+# if __WORDSIZE == 64
+#  define VDSO_NAME  "LINUX_4.15"
+#  define VDSO_HASH  182943605
+
+/* List of system calls which are supported as vsyscalls only
+   for RV64.  */
+#  define HAVE_CLOCK_GETRES64_VSYSCALL   "__vdso_clock_getres"
+#  define HAVE_CLOCK_GETTIME64_VSYSCALL  "__vdso_clock_gettime"
+#  define HAVE_GETTIMEOFDAY_VSYSCALL     "__vdso_gettimeofday"
+# else
+#  define VDSO_NAME  "LINUX_5.4"
+#  define VDSO_HASH  61765876
+
+/* RV32 does not support the gettime VDSO syscalls.  */
+# endif
+
+/* List of system calls which are supported as vsyscalls (for RV32 and
+   RV64).  */
+#  define HAVE_GETCPU_VSYSCALL           "__vdso_getcpu"
 
 # define INTERNAL_SYSCALL(name, nr, args...) \
 	internal_syscall##nr (SYS_ify (name), args)