diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 11:18:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 11:18:32 -0500 |
commit | a157508c9790ccd1c8b5c6a828d6ba85bbe95aaa (patch) | |
tree | 84fc815aac23bb44747e5bdad0559e7383d6f1e6 /include/linux | |
parent | 86c6a2fddf0b89b494c7616f2c06cf915c4bff01 (diff) | |
parent | 89de77a8c557f14d2713a1f43fbc33980e639b98 (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.h | 21 | ||||
-rw-r--r-- | include/linux/time.h | 17 | ||||
-rw-r--r-- | include/linux/timekeeping.h | 49 |
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 @@ | |||
19 | extern int rtc_month_days(unsigned int month, unsigned int year); | 19 | extern int rtc_month_days(unsigned int month, unsigned int year); |
20 | extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year); | 20 | extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year); |
21 | extern int rtc_valid_tm(struct rtc_time *tm); | 21 | extern int rtc_valid_tm(struct rtc_time *tm); |
22 | extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); | 22 | extern time64_t rtc_tm_to_time64(struct rtc_time *tm); |
23 | extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); | 23 | extern void rtc_time64_to_tm(time64_t time, struct rtc_time *tm); |
24 | ktime_t rtc_tm_to_ktime(struct rtc_time tm); | 24 | ktime_t rtc_tm_to_ktime(struct rtc_time tm); |
25 | struct rtc_time rtc_ktime_to_tm(ktime_t kt); | 25 | struct rtc_time rtc_ktime_to_tm(ktime_t kt); |
26 | 26 | ||
27 | /** | ||
28 | * Deprecated. Use rtc_time64_to_tm(). | ||
29 | */ | ||
30 | static 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 | */ | ||
38 | static 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 | ||
42 | extern unsigned long mktime(const unsigned int year, const unsigned int mon, | 42 | extern 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 | */ | ||
49 | static 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 | ||
46 | extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec); | 57 | extern 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 | */ |
12 | extern void do_gettimeofday(struct timeval *tv); | 12 | extern void do_gettimeofday(struct timeval *tv); |
13 | extern int do_settimeofday(const struct timespec *tv); | 13 | extern int do_settimeofday64(const struct timespec64 *ts); |
14 | extern int do_sys_settimeofday(const struct timespec *tv, | 14 | extern 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 | */ |
28 | struct timespec get_monotonic_coarse(void); | 28 | struct timespec64 get_monotonic_coarse64(void); |
29 | extern void getrawmonotonic(struct timespec *ts); | 29 | extern void getrawmonotonic64(struct timespec64 *ts); |
30 | extern void ktime_get_ts64(struct timespec64 *ts); | 30 | extern void ktime_get_ts64(struct timespec64 *ts); |
31 | 31 | ||
32 | extern int __getnstimeofday64(struct timespec64 *tv); | 32 | extern int __getnstimeofday64(struct timespec64 *tv); |
33 | extern void getnstimeofday64(struct timespec64 *tv); | 33 | extern 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 | */ | ||
39 | static inline int do_settimeofday(const struct timespec *ts) | ||
40 | { | ||
41 | return do_settimeofday64(ts); | ||
42 | } | ||
43 | |||
36 | static inline int __getnstimeofday(struct timespec *ts) | 44 | static 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 | ||
64 | static inline void getrawmonotonic(struct timespec *ts) | ||
65 | { | ||
66 | getrawmonotonic64(ts); | ||
67 | } | ||
68 | |||
69 | static 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 | */ | ||
77 | static 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 | |||
57 | static inline int __getnstimeofday(struct timespec *ts) | 85 | static 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 | |||
118 | static inline void getrawmonotonic(struct timespec *ts) | ||
119 | { | ||
120 | struct timespec64 ts64; | ||
121 | |||
122 | getrawmonotonic64(&ts64); | ||
123 | *ts = timespec64_to_timespec(ts64); | ||
124 | } | ||
125 | |||
126 | static inline struct timespec get_monotonic_coarse(void) | ||
127 | { | ||
128 | return timespec64_to_timespec(get_monotonic_coarse64()); | ||
129 | } | ||
89 | #endif | 130 | #endif |
90 | 131 | ||
91 | extern void getboottime(struct timespec *ts); | 132 | extern 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 | */ |
185 | extern void timekeeping_inject_sleeptime(struct timespec *delta); | 226 | extern void timekeeping_inject_sleeptime64(struct timespec64 *delta); |
186 | 227 | ||
187 | /* | 228 | /* |
188 | * PPS accessor | 229 | * PPS accessor |