diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/time.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/time.h b/include/linux/time.h index b3061782dec3..93277a0b2293 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -4,8 +4,11 @@ | |||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
| 7 | # include <linux/bitops.h> | ||
| 7 | # include <linux/cache.h> | 8 | # include <linux/cache.h> |
| 9 | # include <linux/posix_types.h> | ||
| 8 | # include <linux/seqlock.h> | 10 | # include <linux/seqlock.h> |
| 11 | # include <linux/string.h> | ||
| 9 | # include <linux/math64.h> | 12 | # include <linux/math64.h> |
| 10 | #endif | 13 | #endif |
| 11 | 14 | ||
| @@ -256,6 +259,27 @@ static __always_inline void timespec_add_ns(struct timespec *a, u64 ns) | |||
| 256 | a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns); | 259 | a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns); |
| 257 | a->tv_nsec = ns; | 260 | a->tv_nsec = ns; |
| 258 | } | 261 | } |
| 262 | |||
| 263 | static inline void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
| 264 | { | ||
| 265 | __set_bit(__fd, __fdsetp->fds_bits); | ||
| 266 | } | ||
| 267 | |||
| 268 | static inline void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
| 269 | { | ||
| 270 | __clear_bit(__fd, __fdsetp->fds_bits); | ||
| 271 | } | ||
| 272 | |||
| 273 | static inline int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__fdsetp) | ||
| 274 | { | ||
| 275 | return test_bit(__fd, __fdsetp->fds_bits); | ||
| 276 | } | ||
| 277 | |||
| 278 | static inline void __FD_ZERO(__kernel_fd_set *__fdsetp) | ||
| 279 | { | ||
| 280 | memset(__fdsetp->fds_bits, 0, sizeof __fdsetp->fds_bits); | ||
| 281 | } | ||
| 282 | |||
| 259 | #endif /* __KERNEL__ */ | 283 | #endif /* __KERNEL__ */ |
| 260 | 284 | ||
| 261 | #define NFDBITS __NFDBITS | 285 | #define NFDBITS __NFDBITS |
