@@ -22,14 +22,14 @@ extern int do_sys_settimeofday64(const struct timespec64 *tv,
22
22
const struct timezone * tz );
23
23
24
24
/*
25
- * ktime_get() family: read the current time in a multitude of ways,
25
+ * ktime_get() family - read the current time in a multitude of ways.
26
26
*
27
27
* The default time reference is CLOCK_MONOTONIC, starting at
28
28
* boot time but not counting the time spent in suspend.
29
29
* For other references, use the functions with "real", "clocktai",
30
30
* "boottime" and "raw" suffixes.
31
31
*
32
- * To get the time in a different format, use the ones wit
32
+ * To get the time in a different format, use the ones with
33
33
* "ns", "ts64" and "seconds" suffix.
34
34
*
35
35
* See Documentation/core-api/timekeeping.rst for more details.
@@ -74,6 +74,8 @@ extern u32 ktime_get_resolution_ns(void);
74
74
75
75
/**
76
76
* ktime_get_real - get the real (wall-) time in ktime_t format
77
+ *
78
+ * Returns: real (wall) time in ktime_t format
77
79
*/
78
80
static inline ktime_t ktime_get_real (void )
79
81
{
@@ -86,10 +88,12 @@ static inline ktime_t ktime_get_coarse_real(void)
86
88
}
87
89
88
90
/**
89
- * ktime_get_boottime - Returns monotonic time since boot in ktime_t format
91
+ * ktime_get_boottime - Get monotonic time since boot in ktime_t format
90
92
*
91
93
* This is similar to CLOCK_MONTONIC/ktime_get, but also includes the
92
94
* time spent in suspend.
95
+ *
96
+ * Returns: monotonic time since boot in ktime_t format
93
97
*/
94
98
static inline ktime_t ktime_get_boottime (void )
95
99
{
@@ -102,7 +106,9 @@ static inline ktime_t ktime_get_coarse_boottime(void)
102
106
}
103
107
104
108
/**
105
- * ktime_get_clocktai - Returns the TAI time of day in ktime_t format
109
+ * ktime_get_clocktai - Get the TAI time of day in ktime_t format
110
+ *
111
+ * Returns: the TAI time of day in ktime_t format
106
112
*/
107
113
static inline ktime_t ktime_get_clocktai (void )
108
114
{
@@ -144,32 +150,60 @@ static inline u64 ktime_get_coarse_clocktai_ns(void)
144
150
145
151
/**
146
152
* ktime_mono_to_real - Convert monotonic time to clock realtime
153
+ * @mono: monotonic time to convert
154
+ *
155
+ * Returns: time converted to realtime clock
147
156
*/
148
157
static inline ktime_t ktime_mono_to_real (ktime_t mono )
149
158
{
150
159
return ktime_mono_to_any (mono , TK_OFFS_REAL );
151
160
}
152
161
162
+ /**
163
+ * ktime_get_ns - Get the current time in nanoseconds
164
+ *
165
+ * Returns: current time converted to nanoseconds
166
+ */
153
167
static inline u64 ktime_get_ns (void )
154
168
{
155
169
return ktime_to_ns (ktime_get ());
156
170
}
157
171
172
+ /**
173
+ * ktime_get_real_ns - Get the current real/wall time in nanoseconds
174
+ *
175
+ * Returns: current real time converted to nanoseconds
176
+ */
158
177
static inline u64 ktime_get_real_ns (void )
159
178
{
160
179
return ktime_to_ns (ktime_get_real ());
161
180
}
162
181
182
+ /**
183
+ * ktime_get_boottime_ns - Get the monotonic time since boot in nanoseconds
184
+ *
185
+ * Returns: current boottime converted to nanoseconds
186
+ */
163
187
static inline u64 ktime_get_boottime_ns (void )
164
188
{
165
189
return ktime_to_ns (ktime_get_boottime ());
166
190
}
167
191
192
+ /**
193
+ * ktime_get_clocktai_ns - Get the current TAI time of day in nanoseconds
194
+ *
195
+ * Returns: current TAI time converted to nanoseconds
196
+ */
168
197
static inline u64 ktime_get_clocktai_ns (void )
169
198
{
170
199
return ktime_to_ns (ktime_get_clocktai ());
171
200
}
172
201
202
+ /**
203
+ * ktime_get_raw_ns - Get the raw monotonic time in nanoseconds
204
+ *
205
+ * Returns: current raw monotonic time converted to nanoseconds
206
+ */
173
207
static inline u64 ktime_get_raw_ns (void )
174
208
{
175
209
return ktime_to_ns (ktime_get_raw ());
@@ -224,8 +258,8 @@ extern bool timekeeping_rtc_skipresume(void);
224
258
225
259
extern void timekeeping_inject_sleeptime64 (const struct timespec64 * delta );
226
260
227
- /*
228
- * struct ktime_timestanps - Simultaneous mono/boot/real timestamps
261
+ /**
262
+ * struct ktime_timestamps - Simultaneous mono/boot/real timestamps
229
263
* @mono: Monotonic timestamp
230
264
* @boot: Boottime timestamp
231
265
* @real: Realtime timestamp
@@ -242,7 +276,8 @@ struct ktime_timestamps {
242
276
* @cycles: Clocksource counter value to produce the system times
243
277
* @real: Realtime system time
244
278
* @raw: Monotonic raw system time
245
- * @clock_was_set_seq: The sequence number of clock was set events
279
+ * @cs_id: Clocksource ID
280
+ * @clock_was_set_seq: The sequence number of clock-was-set events
246
281
* @cs_was_changed_seq: The sequence number of clocksource change events
247
282
*/
248
283
struct system_time_snapshot {
0 commit comments