diff mbox

[14/16] linux: Enable vDSO clock_gettime64 for mips

Message ID 20191217214728.2886-14-adhemerval.zanella@linaro.org
State Dropped
Headers show

Commit Message

Adhemerval Zanella Dec. 17, 2019, 9:47 p.m. UTC
It was added on Linux 5.4 (commit 1f66c45db3302).
---
 sysdeps/unix/sysv/linux/mips/sysdep.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Florian Weimer Dec. 18, 2019, 3:33 p.m. UTC | #1
* Adhemerval Zanella:

> +#if _MIPS_SIM != _ABI64
> +#define HAVE_CLOCK_GETTIME64_VSYSCALL   "__vdso_clock_gettime64"
> +#endif

I think we typically write “# define” in this situation.

I can't comment on the MIPS content of this patch.

Thanks,
Florian
Siddhesh Poyarekar Jan. 2, 2020, 1:13 p.m. UTC | #2
On 18/12/19 3:17 am, Adhemerval Zanella wrote:
> It was added on Linux 5.4 (commit 1f66c45db3302).
> ---
>  sysdeps/unix/sysv/linux/mips/sysdep.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/sysdeps/unix/sysv/linux/mips/sysdep.h b/sysdeps/unix/sysv/linux/mips/sysdep.h
> index c2bec03806..67a2f74df2 100644
> --- a/sysdeps/unix/sysv/linux/mips/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/mips/sysdep.h
> @@ -16,11 +16,16 @@
>     License along with the GNU C Library.  If not, see
>     <http://www.gnu.org/licenses/>.  */
>  
> +#include <sgidefs.h>
> +

Do you need this at all?  It seems to me that the compiler sets _MIPS_SIM.

>  #define VDSO_NAME  "LINUX_2.6"
>  #define VDSO_HASH  61765110
>  
>  /* List of system calls which are supported as vsyscalls.  */
>  #define HAVE_CLOCK_GETTIME_VSYSCALL     "__vdso_clock_gettime"
> +#if _MIPS_SIM != _ABI64
> +#define HAVE_CLOCK_GETTIME64_VSYSCALL   "__vdso_clock_gettime64"
> +#endif
>  #define HAVE_GETTIMEOFDAY_VSYSCALL      "__vdso_gettimeofday"
>  #define HAVE_CLOCK_GETRES_VSYSCALL      "__vdso_clock_getres"
>  
>
Adhemerval Zanella Jan. 2, 2020, 1:50 p.m. UTC | #3
On 02/01/2020 10:13, Siddhesh Poyarekar wrote:
> On 18/12/19 3:17 am, Adhemerval Zanella wrote:
>> It was added on Linux 5.4 (commit 1f66c45db3302).
>> ---
>>  sysdeps/unix/sysv/linux/mips/sysdep.h | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/sysdeps/unix/sysv/linux/mips/sysdep.h b/sysdeps/unix/sysv/linux/mips/sysdep.h
>> index c2bec03806..67a2f74df2 100644
>> --- a/sysdeps/unix/sysv/linux/mips/sysdep.h
>> +++ b/sysdeps/unix/sysv/linux/mips/sysdep.h
>> @@ -16,11 +16,16 @@
>>     License along with the GNU C Library.  If not, see
>>     <http://www.gnu.org/licenses/>.  */
>>  
>> +#include <sgidefs.h>
>> +
> 
> Do you need this at all?  It seems to me that the compiler sets _MIPS_SIM.

The compiler does sets _MIPS_SIM, but it might not define _ABIXX 
(for instance -mabi=32 does not define _ABI64).

> 
>>  #define VDSO_NAME  "LINUX_2.6"
>>  #define VDSO_HASH  61765110
>>  
>>  /* List of system calls which are supported as vsyscalls.  */
>>  #define HAVE_CLOCK_GETTIME_VSYSCALL     "__vdso_clock_gettime"
>> +#if _MIPS_SIM != _ABI64
>> +#define HAVE_CLOCK_GETTIME64_VSYSCALL   "__vdso_clock_gettime64"
>> +#endif
>>  #define HAVE_GETTIMEOFDAY_VSYSCALL      "__vdso_gettimeofday"
>>  #define HAVE_CLOCK_GETRES_VSYSCALL      "__vdso_clock_getres"
>>  
>>
>
Siddhesh Poyarekar Jan. 2, 2020, 2:09 p.m. UTC | #4
On 02/01/20 7:20 pm, Adhemerval Zanella wrote:
>> Do you need this at all?  It seems to me that the compiler sets _MIPS_SIM.
> 
> The compiler does sets _MIPS_SIM, but it might not define _ABIXX 
> (for instance -mabi=32 does not define _ABI64).
> 

Thanks for checking.  This is good too.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
diff mbox

Patch

diff --git a/sysdeps/unix/sysv/linux/mips/sysdep.h b/sysdeps/unix/sysv/linux/mips/sysdep.h
index c2bec03806..67a2f74df2 100644
--- a/sysdeps/unix/sysv/linux/mips/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/sysdep.h
@@ -16,11 +16,16 @@ 
    License along with the GNU C Library.  If not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <sgidefs.h>
+
 #define VDSO_NAME  "LINUX_2.6"
 #define VDSO_HASH  61765110
 
 /* List of system calls which are supported as vsyscalls.  */
 #define HAVE_CLOCK_GETTIME_VSYSCALL     "__vdso_clock_gettime"
+#if _MIPS_SIM != _ABI64
+#define HAVE_CLOCK_GETTIME64_VSYSCALL   "__vdso_clock_gettime64"
+#endif
 #define HAVE_GETTIMEOFDAY_VSYSCALL      "__vdso_gettimeofday"
 #define HAVE_CLOCK_GETRES_VSYSCALL      "__vdso_clock_getres"