aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390/timex.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-s390/timex.h')
-rw-r--r--include/asm-s390/timex.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/asm-s390/timex.h b/include/asm-s390/timex.h
index 9ee5d8013796..5cbd55cb40ce 100644
--- a/include/asm-s390/timex.h
+++ b/include/asm-s390/timex.h
@@ -11,6 +11,41 @@
11#ifndef _ASM_S390_TIMEX_H 11#ifndef _ASM_S390_TIMEX_H
12#define _ASM_S390_TIMEX_H 12#define _ASM_S390_TIMEX_H
13 13
14/* Inline functions for clock register access. */
15static inline int set_clock(__u64 time)
16{
17 int cc;
18
19 asm volatile(
20 " sck 0(%2)\n"
21 " ipm %0\n"
22 " srl %0,28\n"
23 : "=d" (cc) : "m" (time), "a" (&time) : "cc");
24 return cc;
25}
26
27static inline int store_clock(__u64 *time)
28{
29 int cc;
30
31 asm volatile(
32 " stck 0(%2)\n"
33 " ipm %0\n"
34 " srl %0,28\n"
35 : "=d" (cc), "=m" (*time) : "a" (time) : "cc");
36 return cc;
37}
38
39static inline void set_clock_comparator(__u64 time)
40{
41 asm volatile("sckc 0(%1)" : : "m" (time), "a" (&time));
42}
43
44static inline void store_clock_comparator(__u64 *time)
45{
46 asm volatile("stckc 0(%1)" : "=m" (*time) : "a" (time));
47}
48
14#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ 49#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
15 50
16typedef unsigned long long cycles_t; 51typedef unsigned long long cycles_t;
@@ -32,6 +67,7 @@ static inline cycles_t get_cycles(void)
32 return (cycles_t) get_clock() >> 2; 67 return (cycles_t) get_clock() >> 2;
33} 68}
34 69
70int get_sync_clock(unsigned long long *clock);
35void init_cpu_timer(void); 71void init_cpu_timer(void);
36 72
37#endif 73#endif