diff options
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r-- | kernel/posix-timers.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index fdb710777439..69d5a4b5395b 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -151,7 +151,7 @@ static void posix_timer_fn(unsigned long); | |||
151 | static u64 do_posix_clock_monotonic_gettime_parts( | 151 | static u64 do_posix_clock_monotonic_gettime_parts( |
152 | struct timespec *tp, struct timespec *mo); | 152 | struct timespec *tp, struct timespec *mo); |
153 | int do_posix_clock_monotonic_gettime(struct timespec *tp); | 153 | int do_posix_clock_monotonic_gettime(struct timespec *tp); |
154 | static int do_posix_clock_monotonic_get(clockid_t, struct timespec *tp); | 154 | static int do_posix_clock_monotonic_get(const clockid_t, struct timespec *tp); |
155 | 155 | ||
156 | static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags); | 156 | static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags); |
157 | 157 | ||
@@ -176,7 +176,7 @@ static inline void unlock_timer(struct k_itimer *timr, unsigned long flags) | |||
176 | * the function pointer CALL in struct k_clock. | 176 | * the function pointer CALL in struct k_clock. |
177 | */ | 177 | */ |
178 | 178 | ||
179 | static inline int common_clock_getres(clockid_t which_clock, | 179 | static inline int common_clock_getres(const clockid_t which_clock, |
180 | struct timespec *tp) | 180 | struct timespec *tp) |
181 | { | 181 | { |
182 | tp->tv_sec = 0; | 182 | tp->tv_sec = 0; |
@@ -184,13 +184,15 @@ static inline int common_clock_getres(clockid_t which_clock, | |||
184 | return 0; | 184 | return 0; |
185 | } | 185 | } |
186 | 186 | ||
187 | static inline int common_clock_get(clockid_t which_clock, struct timespec *tp) | 187 | static inline int common_clock_get(const clockid_t which_clock, |
188 | struct timespec *tp) | ||
188 | { | 189 | { |
189 | getnstimeofday(tp); | 190 | getnstimeofday(tp); |
190 | return 0; | 191 | return 0; |
191 | } | 192 | } |
192 | 193 | ||
193 | static inline int common_clock_set(clockid_t which_clock, struct timespec *tp) | 194 | static inline int common_clock_set(const clockid_t which_clock, |
195 | struct timespec *tp) | ||
194 | { | 196 | { |
195 | return do_sys_settimeofday(tp, NULL); | 197 | return do_sys_settimeofday(tp, NULL); |
196 | } | 198 | } |
@@ -207,7 +209,7 @@ static inline int common_timer_create(struct k_itimer *new_timer) | |||
207 | /* | 209 | /* |
208 | * These ones are defined below. | 210 | * These ones are defined below. |
209 | */ | 211 | */ |
210 | static int common_nsleep(clockid_t, int flags, struct timespec *t); | 212 | static int common_nsleep(const clockid_t, int flags, struct timespec *t); |
211 | static void common_timer_get(struct k_itimer *, struct itimerspec *); | 213 | static void common_timer_get(struct k_itimer *, struct itimerspec *); |
212 | static int common_timer_set(struct k_itimer *, int, | 214 | static int common_timer_set(struct k_itimer *, int, |
213 | struct itimerspec *, struct itimerspec *); | 215 | struct itimerspec *, struct itimerspec *); |
@@ -216,7 +218,7 @@ static int common_timer_del(struct k_itimer *timer); | |||
216 | /* | 218 | /* |
217 | * Return nonzero iff we know a priori this clockid_t value is bogus. | 219 | * Return nonzero iff we know a priori this clockid_t value is bogus. |
218 | */ | 220 | */ |
219 | static inline int invalid_clockid(clockid_t which_clock) | 221 | static inline int invalid_clockid(const clockid_t which_clock) |
220 | { | 222 | { |
221 | if (which_clock < 0) /* CPU clock, posix_cpu_* will check it */ | 223 | if (which_clock < 0) /* CPU clock, posix_cpu_* will check it */ |
222 | return 0; | 224 | return 0; |
@@ -522,7 +524,7 @@ static inline struct task_struct * good_sigevent(sigevent_t * event) | |||
522 | return rtn; | 524 | return rtn; |
523 | } | 525 | } |
524 | 526 | ||
525 | void register_posix_clock(clockid_t clock_id, struct k_clock *new_clock) | 527 | void register_posix_clock(const clockid_t clock_id, struct k_clock *new_clock) |
526 | { | 528 | { |
527 | if ((unsigned) clock_id >= MAX_CLOCKS) { | 529 | if ((unsigned) clock_id >= MAX_CLOCKS) { |
528 | printk("POSIX clock register failed for clock_id %d\n", | 530 | printk("POSIX clock register failed for clock_id %d\n", |
@@ -568,7 +570,7 @@ static void release_posix_timer(struct k_itimer *tmr, int it_id_set) | |||
568 | /* Create a POSIX.1b interval timer. */ | 570 | /* Create a POSIX.1b interval timer. */ |
569 | 571 | ||
570 | asmlinkage long | 572 | asmlinkage long |
571 | sys_timer_create(clockid_t which_clock, | 573 | sys_timer_create(const clockid_t which_clock, |
572 | struct sigevent __user *timer_event_spec, | 574 | struct sigevent __user *timer_event_spec, |
573 | timer_t __user * created_timer_id) | 575 | timer_t __user * created_timer_id) |
574 | { | 576 | { |
@@ -1195,7 +1197,8 @@ static u64 do_posix_clock_monotonic_gettime_parts( | |||
1195 | return jiff; | 1197 | return jiff; |
1196 | } | 1198 | } |
1197 | 1199 | ||
1198 | static int do_posix_clock_monotonic_get(clockid_t clock, struct timespec *tp) | 1200 | static int do_posix_clock_monotonic_get(const clockid_t clock, |
1201 | struct timespec *tp) | ||
1199 | { | 1202 | { |
1200 | struct timespec wall_to_mono; | 1203 | struct timespec wall_to_mono; |
1201 | 1204 | ||
@@ -1212,7 +1215,7 @@ int do_posix_clock_monotonic_gettime(struct timespec *tp) | |||
1212 | return do_posix_clock_monotonic_get(CLOCK_MONOTONIC, tp); | 1215 | return do_posix_clock_monotonic_get(CLOCK_MONOTONIC, tp); |
1213 | } | 1216 | } |
1214 | 1217 | ||
1215 | int do_posix_clock_nosettime(clockid_t clockid, struct timespec *tp) | 1218 | int do_posix_clock_nosettime(const clockid_t clockid, struct timespec *tp) |
1216 | { | 1219 | { |
1217 | return -EINVAL; | 1220 | return -EINVAL; |
1218 | } | 1221 | } |
@@ -1224,7 +1227,8 @@ int do_posix_clock_notimer_create(struct k_itimer *timer) | |||
1224 | } | 1227 | } |
1225 | EXPORT_SYMBOL_GPL(do_posix_clock_notimer_create); | 1228 | EXPORT_SYMBOL_GPL(do_posix_clock_notimer_create); |
1226 | 1229 | ||
1227 | int do_posix_clock_nonanosleep(clockid_t clock, int flags, struct timespec *t) | 1230 | int do_posix_clock_nonanosleep(const clockid_t clock, int flags, |
1231 | struct timespec *t) | ||
1228 | { | 1232 | { |
1229 | #ifndef ENOTSUP | 1233 | #ifndef ENOTSUP |
1230 | return -EOPNOTSUPP; /* aka ENOTSUP in userland for POSIX */ | 1234 | return -EOPNOTSUPP; /* aka ENOTSUP in userland for POSIX */ |
@@ -1234,8 +1238,8 @@ int do_posix_clock_nonanosleep(clockid_t clock, int flags, struct timespec *t) | |||
1234 | } | 1238 | } |
1235 | EXPORT_SYMBOL_GPL(do_posix_clock_nonanosleep); | 1239 | EXPORT_SYMBOL_GPL(do_posix_clock_nonanosleep); |
1236 | 1240 | ||
1237 | asmlinkage long | 1241 | asmlinkage long sys_clock_settime(const clockid_t which_clock, |
1238 | sys_clock_settime(clockid_t which_clock, const struct timespec __user *tp) | 1242 | const struct timespec __user *tp) |
1239 | { | 1243 | { |
1240 | struct timespec new_tp; | 1244 | struct timespec new_tp; |
1241 | 1245 | ||
@@ -1248,7 +1252,7 @@ sys_clock_settime(clockid_t which_clock, const struct timespec __user *tp) | |||
1248 | } | 1252 | } |
1249 | 1253 | ||
1250 | asmlinkage long | 1254 | asmlinkage long |
1251 | sys_clock_gettime(clockid_t which_clock, struct timespec __user *tp) | 1255 | sys_clock_gettime(const clockid_t which_clock, struct timespec __user *tp) |
1252 | { | 1256 | { |
1253 | struct timespec kernel_tp; | 1257 | struct timespec kernel_tp; |
1254 | int error; | 1258 | int error; |
@@ -1265,7 +1269,7 @@ sys_clock_gettime(clockid_t which_clock, struct timespec __user *tp) | |||
1265 | } | 1269 | } |
1266 | 1270 | ||
1267 | asmlinkage long | 1271 | asmlinkage long |
1268 | sys_clock_getres(clockid_t which_clock, struct timespec __user *tp) | 1272 | sys_clock_getres(const clockid_t which_clock, struct timespec __user *tp) |
1269 | { | 1273 | { |
1270 | struct timespec rtn_tp; | 1274 | struct timespec rtn_tp; |
1271 | int error; | 1275 | int error; |
@@ -1387,7 +1391,7 @@ void clock_was_set(void) | |||
1387 | long clock_nanosleep_restart(struct restart_block *restart_block); | 1391 | long clock_nanosleep_restart(struct restart_block *restart_block); |
1388 | 1392 | ||
1389 | asmlinkage long | 1393 | asmlinkage long |
1390 | sys_clock_nanosleep(clockid_t which_clock, int flags, | 1394 | sys_clock_nanosleep(const clockid_t which_clock, int flags, |
1391 | const struct timespec __user *rqtp, | 1395 | const struct timespec __user *rqtp, |
1392 | struct timespec __user *rmtp) | 1396 | struct timespec __user *rmtp) |
1393 | { | 1397 | { |
@@ -1419,7 +1423,7 @@ sys_clock_nanosleep(clockid_t which_clock, int flags, | |||
1419 | } | 1423 | } |
1420 | 1424 | ||
1421 | 1425 | ||
1422 | static int common_nsleep(clockid_t which_clock, | 1426 | static int common_nsleep(const clockid_t which_clock, |
1423 | int flags, struct timespec *tsave) | 1427 | int flags, struct timespec *tsave) |
1424 | { | 1428 | { |
1425 | struct timespec t, dum; | 1429 | struct timespec t, dum; |