Arnd Bergmann | 5dbf201 | 2017-10-19 13:14:47 +0200 | [diff] [blame] | 1 | #ifndef _LINUX_TIME32_H |
| 2 | #define _LINUX_TIME32_H |
| 3 | /* |
| 4 | * These are all interfaces based on the old time_t definition |
| 5 | * that overflows in 2038 on 32-bit architectures. New code |
| 6 | * should use the replacements based on time64_t and timespec64. |
| 7 | * |
| 8 | * Any interfaces in here that become unused as we migrate |
| 9 | * code to time64_t should get removed. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/time64.h> |
Arnd Bergmann | 4d5f007 | 2019-01-02 13:28:47 +0100 | [diff] [blame] | 13 | #include <linux/timex.h> |
Arnd Bergmann | 5dbf201 | 2017-10-19 13:14:47 +0200 | [diff] [blame] | 14 | |
Vincenzo Frascino | 9a41623 | 2020-03-20 14:53:36 +0000 | [diff] [blame] | 15 | #include <vdso/time32.h> |
Arnd Bergmann | 9afc5ee | 2018-07-13 12:52:28 +0200 | [diff] [blame] | 16 | |
| 17 | struct old_itimerspec32 { |
| 18 | struct old_timespec32 it_interval; |
| 19 | struct old_timespec32 it_value; |
| 20 | }; |
| 21 | |
Arnd Bergmann | 4faea23 | 2018-04-17 12:03:19 +0200 | [diff] [blame] | 22 | struct old_utimbuf32 { |
| 23 | old_time32_t actime; |
| 24 | old_time32_t modtime; |
| 25 | }; |
| 26 | |
Arnd Bergmann | 4d5f007 | 2019-01-02 13:28:47 +0100 | [diff] [blame] | 27 | struct old_timex32 { |
| 28 | u32 modes; |
| 29 | s32 offset; |
| 30 | s32 freq; |
| 31 | s32 maxerror; |
| 32 | s32 esterror; |
| 33 | s32 status; |
| 34 | s32 constant; |
| 35 | s32 precision; |
| 36 | s32 tolerance; |
| 37 | struct old_timeval32 time; |
| 38 | s32 tick; |
| 39 | s32 ppsfreq; |
| 40 | s32 jitter; |
| 41 | s32 shift; |
| 42 | s32 stabil; |
| 43 | s32 jitcnt; |
| 44 | s32 calcnt; |
| 45 | s32 errcnt; |
| 46 | s32 stbcnt; |
| 47 | s32 tai; |
| 48 | |
| 49 | s32:32; s32:32; s32:32; s32:32; |
| 50 | s32:32; s32:32; s32:32; s32:32; |
| 51 | s32:32; s32:32; s32:32; |
| 52 | }; |
| 53 | |
Arnd Bergmann | 9afc5ee | 2018-07-13 12:52:28 +0200 | [diff] [blame] | 54 | extern int get_old_timespec32(struct timespec64 *, const void __user *); |
| 55 | extern int put_old_timespec32(const struct timespec64 *, void __user *); |
| 56 | extern int get_old_itimerspec32(struct itimerspec64 *its, |
| 57 | const struct old_itimerspec32 __user *uits); |
| 58 | extern int put_old_itimerspec32(const struct itimerspec64 *its, |
| 59 | struct old_itimerspec32 __user *uits); |
Deepa Dinamani | ead2541 | 2018-07-02 22:44:21 -0700 | [diff] [blame] | 60 | struct __kernel_timex; |
| 61 | int get_old_timex32(struct __kernel_timex *, const struct old_timex32 __user *); |
| 62 | int put_old_timex32(struct old_timex32 __user *, const struct __kernel_timex *); |
Arnd Bergmann | 9afc5ee | 2018-07-13 12:52:28 +0200 | [diff] [blame] | 63 | |
Arnd Bergmann | 5dbf201 | 2017-10-19 13:14:47 +0200 | [diff] [blame] | 64 | /** |
Arnd Bergmann | 412c53a | 2020-02-20 20:03:54 -0800 | [diff] [blame] | 65 | * ns_to_kernel_old_timeval - Convert nanoseconds to timeval |
Arnd Bergmann | 5dbf201 | 2017-10-19 13:14:47 +0200 | [diff] [blame] | 66 | * @nsec: the nanoseconds value to be converted |
| 67 | * |
| 68 | * Returns the timeval representation of the nsec parameter. |
| 69 | */ |
Arnd Bergmann | a84d116 | 2018-03-15 17:12:40 +0100 | [diff] [blame] | 70 | extern struct __kernel_old_timeval ns_to_kernel_old_timeval(s64 nsec); |
Arnd Bergmann | 5dbf201 | 2017-10-19 13:14:47 +0200 | [diff] [blame] | 71 | |
Arnd Bergmann | 5dbf201 | 2017-10-19 13:14:47 +0200 | [diff] [blame] | 72 | #endif |