[RFC,v3,12/23] RISC-V: define __vdso_clock_gettime as __vdso_clock_gettime64 for 32-bit

Message ID 2b21e47e43bdfb90c035b76e8a2f245e991a1718.1563321715.git.alistair.francis@wdc.com
State New
Headers show
Series
  • RISC-V glibc port for the 32-bit
Related show

Commit Message

Alistair Francis July 17, 2019, 12:09 a.m.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

---
 sysdeps/unix/sysv/linux/riscv/sysdep.h | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.22.0

Comments

Arnd Bergmann July 17, 2019, 8:16 a.m. | #1
On Wed, Jul 17, 2019 at 2:12 AM Alistair Francis
<alistair.francis@wdc.com> wrote:
>

> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

> ---

>  sysdeps/unix/sysv/linux/riscv/sysdep.h | 4 ++++

>  1 file changed, 4 insertions(+)

>

> diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h

> index e66e9f032a..ea47b9b82c 100644

> --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h

> +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h

> @@ -171,6 +171,10 @@

>  # ifndef __vdso_clock_getres

>  #  define __vdso_clock_getres __vdso_clock_getres_time64

>  # endif

> +

> +# ifndef __vdso_clock_gettime

> +#  define __vdso_clock_gettime __vdso_clock_gettime64

> +# endif

>  #endif /* __riscv_xlen == 32 */



I had not noticed this when commenting on the other patches. What is
the purpose of doing this?

As mentioned, I don't think we should have __vdso_clock_getres_time64()
at all (no caller cares about this being fast).
The "#define__vdso_clock_gettime __vdso_clock_gettime64" should
be harmless but leads to confusion because other architectures that
have both cannot do this.

      Arnd
Alistair Francis July 19, 2019, 5:15 p.m. | #2
On Wed, Jul 17, 2019 at 1:16 AM Arnd Bergmann <arnd@arndb.de> wrote:
>

> On Wed, Jul 17, 2019 at 2:12 AM Alistair Francis

> <alistair.francis@wdc.com> wrote:

> >

> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

> > ---

> >  sysdeps/unix/sysv/linux/riscv/sysdep.h | 4 ++++

> >  1 file changed, 4 insertions(+)

> >

> > diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h

> > index e66e9f032a..ea47b9b82c 100644

> > --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h

> > +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h

> > @@ -171,6 +171,10 @@

> >  # ifndef __vdso_clock_getres

> >  #  define __vdso_clock_getres __vdso_clock_getres_time64

> >  # endif

> > +

> > +# ifndef __vdso_clock_gettime

> > +#  define __vdso_clock_gettime __vdso_clock_gettime64

> > +# endif

> >  #endif /* __riscv_xlen == 32 */

>

>

> I had not noticed this when commenting on the other patches. What is

> the purpose of doing this?

>

> As mentioned, I don't think we should have __vdso_clock_getres_time64()

> at all (no caller cares about this being fast).

> The "#define__vdso_clock_gettime __vdso_clock_gettime64" should

> be harmless but leads to confusion because other architectures that

> have both cannot do this.


These were required to avoid build failures, but I think I have a
better solution and have removed these patches.

Alistair

>

>       Arnd

Patch

diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
index e66e9f032a..ea47b9b82c 100644
--- a/sysdeps/unix/sysv/linux/riscv/sysdep.h
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
@@ -171,6 +171,10 @@ 
 # ifndef __vdso_clock_getres
 #  define __vdso_clock_getres __vdso_clock_getres_time64
 # endif
+
+# ifndef __vdso_clock_gettime
+#  define __vdso_clock_gettime __vdso_clock_gettime64
+# endif
 #endif /* __riscv_xlen == 32 */
 
 #undef SYS_ify