aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 11:18:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 11:18:32 -0500
commita157508c9790ccd1c8b5c6a828d6ba85bbe95aaa (patch)
tree84fc815aac23bb44747e5bdad0559e7383d6f1e6 /include/linux
parent86c6a2fddf0b89b494c7616f2c06cf915c4bff01 (diff)
parent89de77a8c557f14d2713a1f43fbc33980e639b98 (diff)
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer core updates from Thomas Gleixner: "The time(r) departement provides: - more infrastructure work on the year 2038 issue - a few fixes in the Armada SoC timers - the usual pile of fixlets and improvements" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource: armada-370-xp: Use the reference clock on A375 SoC watchdog: orion: Use the reference clock on Armada 375 SoC clocksource: armada-370-xp: Add missing clock enable time: Fix sign bug in NTP mult overflow warning time: Remove timekeeping_inject_sleeptime() rtc: Update suspend/resume timing to use 64bit time rtc/lib: Provide y2038 safe rtc_tm_to_time()/rtc_time_to_tm() replacement time: Fixup comments to reflect usage of timespec64 time: Expose get_monotonic_coarse64() for in-kernel uses time: Expose getrawmonotonic64 for in-kernel uses time: Provide y2038 safe mktime() replacement time: Provide y2038 safe timekeeping_inject_sleeptime() replacement time: Provide y2038 safe do_settimeofday() replacement time: Complete NTP adjustment threshold judging conditions time: Avoid possible NTP adjustment mult overflow. time: Rename udelay_test.c to test_udelay.c clocksource: sirf: Remove hard-coded clock rate
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/rtc.h21
-rw-r--r--include/linux/time.h17
-rw-r--r--include/linux/timekeeping.h49
3 files changed, 78 insertions, 9 deletions
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index c2c28975293c..6d6be09a2fe5 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -19,11 +19,28 @@
19extern int rtc_month_days(unsigned int month, unsigned int year); 19extern int rtc_month_days(unsigned int month, unsigned int year);
20extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year); 20extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year);
21extern int rtc_valid_tm(struct rtc_time *tm); 21extern int rtc_valid_tm(struct rtc_time *tm);
22extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); 22extern time64_t rtc_tm_to_time64(struct rtc_time *tm);
23extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); 23extern void rtc_time64_to_tm(time64_t time, struct rtc_time *tm);
24ktime_t rtc_tm_to_ktime(struct rtc_time tm); 24ktime_t rtc_tm_to_ktime(struct rtc_time tm);
25struct rtc_time rtc_ktime_to_tm(ktime_t kt); 25struct rtc_time rtc_ktime_to_tm(ktime_t kt);
26 26
27/**
28 * Deprecated. Use rtc_time64_to_tm().
29 */
30static inline void rtc_time_to_tm(unsigned long time, struct rtc_time *tm)
31{
32 rtc_time64_to_tm(time, tm);
33}
34
35/**
36 * Deprecated. Use rtc_tm_to_time64().
37 */
38static inline int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time)
39{
40 *time = rtc_tm_to_time64(tm);
41
42 return 0;
43}
27 44
28#include <linux/device.h> 45#include <linux/device.h>
29#include <linux/seq_file.h> 46#include <linux/seq_file.h>
diff --git a/include/linux/time.h b/include/linux/time.h
index 8c42cf8d2444..203c2ad40d71 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -39,9 +39,20 @@ static inline int timeval_compare(const struct timeval *lhs, const struct timeva
39 return lhs->tv_usec - rhs->tv_usec; 39 return lhs->tv_usec - rhs->tv_usec;
40} 40}
41 41
42extern unsigned long mktime(const unsigned int year, const unsigned int mon, 42extern time64_t mktime64(const unsigned int year, const unsigned int mon,
43 const unsigned int day, const unsigned int hour, 43 const unsigned int day, const unsigned int hour,
44 const unsigned int min, const unsigned int sec); 44 const unsigned int min, const unsigned int sec);
45
46/**
47 * Deprecated. Use mktime64().
48 */
49static inline unsigned long mktime(const unsigned int year,
50 const unsigned int mon, const unsigned int day,
51 const unsigned int hour, const unsigned int min,
52 const unsigned int sec)
53{
54 return mktime64(year, mon, day, hour, min, sec);
55}
45 56
46extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec); 57extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec);
47 58
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 1caa6b04fdc5..961fea373f83 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -10,7 +10,7 @@ extern int timekeeping_suspended;
10 * Get and set timeofday 10 * Get and set timeofday
11 */ 11 */
12extern void do_gettimeofday(struct timeval *tv); 12extern void do_gettimeofday(struct timeval *tv);
13extern int do_settimeofday(const struct timespec *tv); 13extern int do_settimeofday64(const struct timespec64 *ts);
14extern int do_sys_settimeofday(const struct timespec *tv, 14extern int do_sys_settimeofday(const struct timespec *tv,
15 const struct timezone *tz); 15 const struct timezone *tz);
16 16
@@ -25,14 +25,22 @@ struct timespec __current_kernel_time(void);
25/* 25/*
26 * timespec based interfaces 26 * timespec based interfaces
27 */ 27 */
28struct timespec get_monotonic_coarse(void); 28struct timespec64 get_monotonic_coarse64(void);
29extern void getrawmonotonic(struct timespec *ts); 29extern void getrawmonotonic64(struct timespec64 *ts);
30extern void ktime_get_ts64(struct timespec64 *ts); 30extern void ktime_get_ts64(struct timespec64 *ts);
31 31
32extern int __getnstimeofday64(struct timespec64 *tv); 32extern int __getnstimeofday64(struct timespec64 *tv);
33extern void getnstimeofday64(struct timespec64 *tv); 33extern void getnstimeofday64(struct timespec64 *tv);
34 34
35#if BITS_PER_LONG == 64 35#if BITS_PER_LONG == 64
36/**
37 * Deprecated. Use do_settimeofday64().
38 */
39static inline int do_settimeofday(const struct timespec *ts)
40{
41 return do_settimeofday64(ts);
42}
43
36static inline int __getnstimeofday(struct timespec *ts) 44static inline int __getnstimeofday(struct timespec *ts)
37{ 45{
38 return __getnstimeofday64(ts); 46 return __getnstimeofday64(ts);
@@ -53,7 +61,27 @@ static inline void ktime_get_real_ts(struct timespec *ts)
53 getnstimeofday64(ts); 61 getnstimeofday64(ts);
54} 62}
55 63
64static inline void getrawmonotonic(struct timespec *ts)
65{
66 getrawmonotonic64(ts);
67}
68
69static inline struct timespec get_monotonic_coarse(void)
70{
71 return get_monotonic_coarse64();
72}
56#else 73#else
74/**
75 * Deprecated. Use do_settimeofday64().
76 */
77static inline int do_settimeofday(const struct timespec *ts)
78{
79 struct timespec64 ts64;
80
81 ts64 = timespec_to_timespec64(*ts);
82 return do_settimeofday64(&ts64);
83}
84
57static inline int __getnstimeofday(struct timespec *ts) 85static inline int __getnstimeofday(struct timespec *ts)
58{ 86{
59 struct timespec64 ts64; 87 struct timespec64 ts64;
@@ -86,6 +114,19 @@ static inline void ktime_get_real_ts(struct timespec *ts)
86 getnstimeofday64(&ts64); 114 getnstimeofday64(&ts64);
87 *ts = timespec64_to_timespec(ts64); 115 *ts = timespec64_to_timespec(ts64);
88} 116}
117
118static inline void getrawmonotonic(struct timespec *ts)
119{
120 struct timespec64 ts64;
121
122 getrawmonotonic64(&ts64);
123 *ts = timespec64_to_timespec(ts64);
124}
125
126static inline struct timespec get_monotonic_coarse(void)
127{
128 return timespec64_to_timespec(get_monotonic_coarse64());
129}
89#endif 130#endif
90 131
91extern void getboottime(struct timespec *ts); 132extern void getboottime(struct timespec *ts);
@@ -182,7 +223,7 @@ static inline void timekeeping_clocktai(struct timespec *ts)
182/* 223/*
183 * RTC specific 224 * RTC specific
184 */ 225 */
185extern void timekeeping_inject_sleeptime(struct timespec *delta); 226extern void timekeeping_inject_sleeptime64(struct timespec64 *delta);
186 227
187/* 228/*
188 * PPS accessor 229 * PPS accessor