diff options
| author | Roland McGrath <roland@redhat.com> | 2005-03-07 18:15:40 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-07 18:15:40 -0800 |
| commit | 8b9cfca63e45badb418550c61397be4c33022752 (patch) | |
| tree | facc768a003ff4f097243e934f58dac848c97f3c /include/linux | |
| parent | d6b7a781c51c91dd054e5c437885205592faac21 (diff) | |
[PATCH] posix-timers: tidy up clock interfaces and consolidate dispatch logic
This patch cleans up the posix-timers interfaces for defining clocks, and the
calls to them. It fixes some sloppy types, adds a clockid_t parameter to the
calls that lacked it, and adds a function pointer that can be used for
clock_getres. It further cleans up the posix-timers.c code using the k_clock
function pointers or default functions when no hooks are supplied,
consolidating repeated code into shared inline functions or macros. This
paves the way for adding the CPU clock hooks.
The mmtimer.c changes are untested, but obviously can't be wrong. There
aren't any other struct k_clock definitions in the tree, but any others would
need to be updated for the function signature changes.
Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/posix-timers.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 006f3e9af475..61f4b12d82c1 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h @@ -30,12 +30,12 @@ struct k_clock_abs { }; struct k_clock { int res; /* in nano seconds */ + int (*clock_getres) (clockid_t which_clock, struct timespec *tp); struct k_clock_abs *abs_struct; - int (*clock_set) (struct timespec * tp); - int (*clock_get) (struct timespec * tp); + int (*clock_set) (clockid_t which_clock, struct timespec * tp); + int (*clock_get) (clockid_t which_clock, struct timespec * tp); int (*timer_create) (struct k_itimer *timer); - int (*nsleep) (int which_clock, int flags, - struct timespec * t); + int (*nsleep) (clockid_t which_clock, int flags, struct timespec *); int (*timer_set) (struct k_itimer * timr, int flags, struct itimerspec * new_setting, struct itimerspec * old_setting); @@ -44,12 +44,12 @@ struct k_clock { struct itimerspec * cur_setting); }; -void register_posix_clock(int clock_id, struct k_clock *new_clock); +void register_posix_clock(clockid_t clock_id, struct k_clock *new_clock); /* Error handlers for timer_create, nanosleep and settime */ int do_posix_clock_notimer_create(struct k_itimer *timer); -int do_posix_clock_nonanosleep(int which_clock, int flags, struct timespec * t); -int do_posix_clock_nosettime(struct timespec *tp); +int do_posix_clock_nonanosleep(clockid_t, int flags, struct timespec *); +int do_posix_clock_nosettime(clockid_t, struct timespec *tp); /* function to call to trigger timer event */ int posix_timer_event(struct k_itimer *timr, int si_private); |
