diff options
Diffstat (limited to 'include/linux/time.h')
| -rw-r--r-- | include/linux/time.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/include/linux/time.h b/include/linux/time.h index d9cdba54b789..0cd696cee998 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -73,12 +73,6 @@ extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); | |||
| 73 | #define timespec_valid(ts) \ | 73 | #define timespec_valid(ts) \ |
| 74 | (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) | 74 | (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) |
| 75 | 75 | ||
| 76 | /* | ||
| 77 | * 64-bit nanosec type. Large enough to span 292+ years in nanosecond | ||
| 78 | * resolution. Ought to be enough for a while. | ||
| 79 | */ | ||
| 80 | typedef s64 nsec_t; | ||
| 81 | |||
| 82 | extern struct timespec xtime; | 76 | extern struct timespec xtime; |
| 83 | extern struct timespec wall_to_monotonic; | 77 | extern struct timespec wall_to_monotonic; |
| 84 | extern seqlock_t xtime_lock; | 78 | extern seqlock_t xtime_lock; |
| @@ -101,6 +95,7 @@ extern long do_utimes(int dfd, char __user *filename, struct timeval *times); | |||
| 101 | struct itimerval; | 95 | struct itimerval; |
| 102 | extern int do_setitimer(int which, struct itimerval *value, | 96 | extern int do_setitimer(int which, struct itimerval *value, |
| 103 | struct itimerval *ovalue); | 97 | struct itimerval *ovalue); |
| 98 | extern unsigned int alarm_setitimer(unsigned int seconds); | ||
| 104 | extern int do_getitimer(int which, struct itimerval *value); | 99 | extern int do_getitimer(int which, struct itimerval *value); |
| 105 | extern void getnstimeofday(struct timespec *tv); | 100 | extern void getnstimeofday(struct timespec *tv); |
| 106 | 101 | ||
| @@ -113,9 +108,9 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | |||
| 113 | * Returns the scalar nanosecond representation of the timespec | 108 | * Returns the scalar nanosecond representation of the timespec |
| 114 | * parameter. | 109 | * parameter. |
| 115 | */ | 110 | */ |
| 116 | static inline nsec_t timespec_to_ns(const struct timespec *ts) | 111 | static inline s64 timespec_to_ns(const struct timespec *ts) |
| 117 | { | 112 | { |
| 118 | return ((nsec_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; | 113 | return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; |
| 119 | } | 114 | } |
| 120 | 115 | ||
| 121 | /** | 116 | /** |
| @@ -125,9 +120,9 @@ static inline nsec_t timespec_to_ns(const struct timespec *ts) | |||
| 125 | * Returns the scalar nanosecond representation of the timeval | 120 | * Returns the scalar nanosecond representation of the timeval |
| 126 | * parameter. | 121 | * parameter. |
| 127 | */ | 122 | */ |
| 128 | static inline nsec_t timeval_to_ns(const struct timeval *tv) | 123 | static inline s64 timeval_to_ns(const struct timeval *tv) |
| 129 | { | 124 | { |
| 130 | return ((nsec_t) tv->tv_sec * NSEC_PER_SEC) + | 125 | return ((s64) tv->tv_sec * NSEC_PER_SEC) + |
| 131 | tv->tv_usec * NSEC_PER_USEC; | 126 | tv->tv_usec * NSEC_PER_USEC; |
| 132 | } | 127 | } |
| 133 | 128 | ||
| @@ -137,7 +132,7 @@ static inline nsec_t timeval_to_ns(const struct timeval *tv) | |||
| 137 | * | 132 | * |
| 138 | * Returns the timespec representation of the nsec parameter. | 133 | * Returns the timespec representation of the nsec parameter. |
| 139 | */ | 134 | */ |
| 140 | extern struct timespec ns_to_timespec(const nsec_t nsec); | 135 | extern struct timespec ns_to_timespec(const s64 nsec); |
| 141 | 136 | ||
| 142 | /** | 137 | /** |
| 143 | * ns_to_timeval - Convert nanoseconds to timeval | 138 | * ns_to_timeval - Convert nanoseconds to timeval |
| @@ -145,7 +140,7 @@ extern struct timespec ns_to_timespec(const nsec_t nsec); | |||
| 145 | * | 140 | * |
| 146 | * Returns the timeval representation of the nsec parameter. | 141 | * Returns the timeval representation of the nsec parameter. |
| 147 | */ | 142 | */ |
| 148 | extern struct timeval ns_to_timeval(const nsec_t nsec); | 143 | extern struct timeval ns_to_timeval(const s64 nsec); |
| 149 | 144 | ||
| 150 | #endif /* __KERNEL__ */ | 145 | #endif /* __KERNEL__ */ |
| 151 | 146 | ||
