arm64: vdso32: Include common headers in the vdso library
[linux-2.6-microblaze.git] / arch / arm64 / include / asm / vdso / compat_gettimeofday.h
index 537b1e6..b6907ae 100644 (file)
@@ -8,12 +8,10 @@
 #ifndef __ASSEMBLY__
 
 #include <asm/unistd.h>
-#include <uapi/linux/time.h>
+#include <asm/errno.h>
 
 #include <asm/vdso/compat_barrier.h>
 
-#define __VDSO_USE_SYSCALL             ULLONG_MAX
-
 #define VDSO_HAS_CLOCK_GETRES          1
 
 #define BUILD_VDSO32                   1
@@ -78,10 +76,6 @@ int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
        register long ret asm ("r0");
        register long nr asm("r7") = __NR_compat_clock_getres_time64;
 
-       /* The checks below are required for ABI consistency with arm */
-       if ((_clkid >= MAX_CLOCKS) && (_ts == NULL))
-               return -EINVAL;
-
        asm volatile(
        "       swi #0\n"
        : "=r" (ret)
@@ -99,10 +93,6 @@ int clock_getres32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
        register long ret asm ("r0");
        register long nr asm("r7") = __NR_compat_clock_getres;
 
-       /* The checks below are required for ABI consistency with arm */
-       if ((_clkid >= MAX_CLOCKS) && (_ts == NULL))
-               return -EINVAL;
-
        asm volatile(
        "       swi #0\n"
        : "=r" (ret)
@@ -117,11 +107,12 @@ static __always_inline u64 __arch_get_hw_counter(s32 clock_mode)
        u64 res;
 
        /*
-        * clock_mode == 0 implies that vDSO are enabled otherwise
-        * fallback on syscall.
+        * Core checks for mode already, so this raced against a concurrent
+        * update. Return something. Core will do another round and then
+        * see the mode change and fallback to the syscall.
         */
-       if (clock_mode)
-               return __VDSO_USE_SYSCALL;
+       if (clock_mode == VDSO_CLOCKMODE_NONE)
+               return 0;
 
        /*
         * This isb() is required to prevent that the counter value