~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/csky/include/asm/vdso/gettimeofday.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 
  3 #ifndef __ASM_VDSO_CSKY_GETTIMEOFDAY_H
  4 #define __ASM_VDSO_CSKY_GETTIMEOFDAY_H
  5 
  6 #ifndef __ASSEMBLY__
  7 
  8 #include <asm/barrier.h>
  9 #include <asm/unistd.h>
 10 #include <abi/regdef.h>
 11 #include <uapi/linux/time.h>
 12 
 13 #define VDSO_HAS_CLOCK_GETRES   1
 14 
 15 static __always_inline
 16 int gettimeofday_fallback(struct __kernel_old_timeval *_tv,
 17                           struct timezone *_tz)
 18 {
 19         register struct __kernel_old_timeval *tv asm("a0") = _tv;
 20         register struct timezone *tz asm("a1") = _tz;
 21         register long ret asm("a0");
 22         register long nr asm(syscallid) = __NR_gettimeofday;
 23 
 24         asm volatile ("trap 0\n"
 25                       : "=r" (ret)
 26                       : "r"(tv), "r"(tz), "r"(nr)
 27                       : "memory");
 28 
 29         return ret;
 30 }
 31 
 32 static __always_inline
 33 long clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
 34 {
 35         register clockid_t clkid asm("a0") = _clkid;
 36         register struct __kernel_timespec *ts asm("a1") = _ts;
 37         register long ret asm("a0");
 38         register long nr asm(syscallid) = __NR_clock_gettime64;
 39 
 40         asm volatile ("trap 0\n"
 41                       : "=r" (ret)
 42                       : "r"(clkid), "r"(ts), "r"(nr)
 43                       : "memory");
 44 
 45         return ret;
 46 }
 47 
 48 static __always_inline
 49 long clock_gettime32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
 50 {
 51         register clockid_t clkid asm("a0") = _clkid;
 52         register struct old_timespec32 *ts asm("a1") = _ts;
 53         register long ret asm("a0");
 54         register long nr asm(syscallid) = __NR_clock_gettime;
 55 
 56         asm volatile ("trap 0\n"
 57                       : "=r" (ret)
 58                       : "r"(clkid), "r"(ts), "r"(nr)
 59                       : "memory");
 60 
 61         return ret;
 62 }
 63 
 64 static __always_inline
 65 int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
 66 {
 67         register clockid_t clkid asm("a0") = _clkid;
 68         register struct __kernel_timespec *ts asm("a1") = _ts;
 69         register long ret asm("a0");
 70         register long nr asm(syscallid) = __NR_clock_getres_time64;
 71 
 72         asm volatile ("trap 0\n"
 73                       : "=r" (ret)
 74                       : "r"(clkid), "r"(ts), "r"(nr)
 75                       : "memory");
 76 
 77         return ret;
 78 }
 79 
 80 static __always_inline
 81 int clock_getres32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
 82 {
 83         register clockid_t clkid asm("a0") = _clkid;
 84         register struct old_timespec32 *ts asm("a1") = _ts;
 85         register long ret asm("a0");
 86         register long nr asm(syscallid) = __NR_clock_getres;
 87 
 88         asm volatile ("trap 0\n"
 89                       : "=r" (ret)
 90                       : "r"(clkid), "r"(ts), "r"(nr)
 91                       : "memory");
 92 
 93         return ret;
 94 }
 95 
 96 uint64_t csky_pmu_read_cc(void);
 97 static __always_inline u64 __arch_get_hw_counter(s32 clock_mode,
 98                                                  const struct vdso_data *vd)
 99 {
100 #ifdef CONFIG_CSKY_PMU_V1
101         return csky_pmu_read_cc();
102 #else
103         return 0;
104 #endif
105 }
106 
107 static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
108 {
109         return _vdso_data;
110 }
111 
112 #endif /* !__ASSEMBLY__ */
113 
114 #endif /* __ASM_VDSO_CSKY_GETTIMEOFDAY_H */
115 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php