Patchwork [RFC,v6,09/23] RISC-V: Add support for 32-bit vDSO calls

login
register
mail settings
Submitter Alistair Francis
Date Jan. 12, 2020, 10:33 a.m.
Message ID <29811415ee8fa8e8e4cb379903c2199b5df54f9b.1578824547.git.alistair.francis@wdc.com>
Download mbox | patch
Permalink /patch/37317/
State New
Headers show

Comments

Alistair Francis - Jan. 12, 2020, 10:33 a.m.
---
 sysdeps/unix/sysv/linux/riscv/sysdep.h | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
arnd@arndb.de - Jan. 13, 2020, 1:33 p.m.
On Sun, Jan 12, 2020 at 11:40 AM Alistair Francis
<alistair.francis@wdc.com> wrote:
> +# if __riscv_xlen == 32
> +#  define VDSO_NAME  "LINUX_5.4"
> +#  define VDSO_HASH  61765876

> +#  define HAVE_CLOCK_GETTIME64_VSYSCALL        "__vdso_clock_gettime64"
> +#  define HAVE_GETCPU_VSYSCALL         "__vdso_getcpu"

Mainline linux doesn't have these yet on risc-v. I assume you have
patches to add them?

      Arnd
Alistair Francis - Jan. 14, 2020, 7:23 a.m.
On Mon, Jan 13, 2020 at 11:33 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Sun, Jan 12, 2020 at 11:40 AM Alistair Francis
> <alistair.francis@wdc.com> wrote:
> > +# if __riscv_xlen == 32
> > +#  define VDSO_NAME  "LINUX_5.4"
> > +#  define VDSO_HASH  61765876
>
> > +#  define HAVE_CLOCK_GETTIME64_VSYSCALL        "__vdso_clock_gettime64"
> > +#  define HAVE_GETCPU_VSYSCALL         "__vdso_getcpu"
>
> Mainline linux doesn't have these yet on risc-v. I assume you have
> patches to add them?

No... I don't. I just assumed these were supported. I will drop this.

Alistair

>
>       Arnd

Patch

diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
index d030bf0db0..b02a5c30f6 100644
--- a/sysdeps/unix/sysv/linux/riscv/sysdep.h
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
@@ -194,14 +194,23 @@ 
 
 #ifndef __ASSEMBLER__
 
-# define VDSO_NAME  "LINUX_4.15"
-# define VDSO_HASH  182943605
+# if __riscv_xlen == 32
+#  define VDSO_NAME  "LINUX_5.4"
+#  define VDSO_HASH  61765876
 
 /* 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"
+#  define HAVE_CLOCK_GETTIME64_VSYSCALL	"__vdso_clock_gettime64"
+#  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
 
 /* Define a macro which expands into the inline wrapper code for a system
    call.  */