mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 23:21:46 +00:00
ktime: Kill non-scalar ktime_t implementation for 2038
The non-scalar ktime_t implementation is basically a timespec which has to be changed to support dates past 2038 on 32bit systems. This patch removes the non-scalar ktime_t implementation, forcing the scalar s64 nanosecond version on all architectures. This may have additional performance overhead on some 32bit systems when converting between ktime_t and timespec structures, however the majority of 32bit systems (arm and i386) were already using scalar ktime_t, so no performance regressions will be seen on those platforms. On affected platforms, I'm open to finding optimizations, including avoiding converting to timespecs where possible. [ tglx: We can now cleanup the ktime_t.tv64 mess, but thats a different issue and we can throw a coccinelle script at it ] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
This commit is contained in:
parent
76f4108892
commit
24e4a8c3e8
9 changed files with 7 additions and 246 deletions
|
@ -19,6 +19,10 @@ extern struct timezone sys_tz;
|
|||
|
||||
#define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1)
|
||||
|
||||
/* Located here for timespec_valid_strict */
|
||||
#define KTIME_MAX ((s64)~((u64)1 << 63))
|
||||
#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
|
||||
|
||||
static inline int timespec_equal(const struct timespec *a,
|
||||
const struct timespec *b)
|
||||
{
|
||||
|
@ -84,13 +88,6 @@ static inline struct timespec timespec_sub(struct timespec lhs,
|
|||
return ts_delta;
|
||||
}
|
||||
|
||||
#define KTIME_MAX ((s64)~((u64)1 << 63))
|
||||
#if (BITS_PER_LONG == 64)
|
||||
# define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
|
||||
#else
|
||||
# define KTIME_SEC_MAX LONG_MAX
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Returns true if the timespec is norm, false if denorm:
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue