aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/cputime.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/cputime.h')
-rw-r--r--arch/s390/include/asm/cputime.h26
1 files changed, 0 insertions, 26 deletions
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index b91e960e4045..221b454c734a 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -22,15 +22,7 @@ typedef unsigned long long __nocast cputime64_t;
22 22
23static inline unsigned long __div(unsigned long long n, unsigned long base) 23static inline unsigned long __div(unsigned long long n, unsigned long base)
24{ 24{
25#ifndef CONFIG_64BIT
26 register_pair rp;
27
28 rp.pair = n >> 1;
29 asm ("dr %0,%1" : "+d" (rp) : "d" (base >> 1));
30 return rp.subreg.odd;
31#else /* CONFIG_64BIT */
32 return n / base; 25 return n / base;
33#endif /* CONFIG_64BIT */
34} 26}
35 27
36#define cputime_one_jiffy jiffies_to_cputime(1) 28#define cputime_one_jiffy jiffies_to_cputime(1)
@@ -101,17 +93,8 @@ static inline void cputime_to_timespec(const cputime_t cputime,
101 struct timespec *value) 93 struct timespec *value)
102{ 94{
103 unsigned long long __cputime = (__force unsigned long long) cputime; 95 unsigned long long __cputime = (__force unsigned long long) cputime;
104#ifndef CONFIG_64BIT
105 register_pair rp;
106
107 rp.pair = __cputime >> 1;
108 asm ("dr %0,%1" : "+d" (rp) : "d" (CPUTIME_PER_SEC / 2));
109 value->tv_nsec = rp.subreg.even * NSEC_PER_USEC / CPUTIME_PER_USEC;
110 value->tv_sec = rp.subreg.odd;
111#else
112 value->tv_nsec = (__cputime % CPUTIME_PER_SEC) * NSEC_PER_USEC / CPUTIME_PER_USEC; 96 value->tv_nsec = (__cputime % CPUTIME_PER_SEC) * NSEC_PER_USEC / CPUTIME_PER_USEC;
113 value->tv_sec = __cputime / CPUTIME_PER_SEC; 97 value->tv_sec = __cputime / CPUTIME_PER_SEC;
114#endif
115} 98}
116 99
117/* 100/*
@@ -129,17 +112,8 @@ static inline void cputime_to_timeval(const cputime_t cputime,
129 struct timeval *value) 112 struct timeval *value)
130{ 113{
131 unsigned long long __cputime = (__force unsigned long long) cputime; 114 unsigned long long __cputime = (__force unsigned long long) cputime;
132#ifndef CONFIG_64BIT
133 register_pair rp;
134
135 rp.pair = __cputime >> 1;
136 asm ("dr %0,%1" : "+d" (rp) : "d" (CPUTIME_PER_USEC / 2));
137 value->tv_usec = rp.subreg.even / CPUTIME_PER_USEC;
138 value->tv_sec = rp.subreg.odd;
139#else
140 value->tv_usec = (__cputime % CPUTIME_PER_SEC) / CPUTIME_PER_USEC; 115 value->tv_usec = (__cputime % CPUTIME_PER_SEC) / CPUTIME_PER_USEC;
141 value->tv_sec = __cputime / CPUTIME_PER_SEC; 116 value->tv_sec = __cputime / CPUTIME_PER_SEC;
142#endif
143} 117}
144 118
145/* 119/*