diff options
| author | Christoph Lameter <clameter@sgi.com> | 2004-10-25 04:22:46 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-25 04:22:46 -0700 |
| commit | a3bbfb37e8d43960371299484b4a0b29690c8f18 (patch) | |
| tree | 419de7b5c74f8f44f4f78e0142395fde14d3fd49 /include/linux | |
| parent | 3a9e3908014aa3eb130b56853db6ef7fab2ee330 (diff) | |
[PATCH] Posix layer <-> clock driver API fix
This is needed for an mmtimer driver update that we are currently working
on. The mmtimer driver provides CLOCK_SGI_CYCLE via clock_gettime and
clock_settime.
With this api fix one will be able to use timer_create, timer_settime and
friends from userspace to schedule and receive signals via timer interrupts
of mmtimer.
Changelog
* Clean up timer api for drivers that use register_posix_clock. Drivers
will then be able to use posix timers to schedule interrupts.
* Change API for posix_clocks[].timer_create to only pass one pointer
to a k_itimer structure that is now allocated and managed by the
posix layer in the same way as for the other posix timer
functions.
* Isolate a posix_timer_event(timr) function in posix-timers.c that may
be called by the interrupt routine of a timer to signal that the
scheduled event has taken place.
Signed-off-by: Christoph Lameter <clameter@sgi.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 | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index e7c08acbe796..006f3e9af475 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h @@ -33,8 +33,7 @@ struct k_clock { struct k_clock_abs *abs_struct; int (*clock_set) (struct timespec * tp); int (*clock_get) (struct timespec * tp); - int (*timer_create) (int which_clock, struct sigevent __user *timer_event_spec, - timer_t __user * created_timer_id); + int (*timer_create) (struct k_itimer *timer); int (*nsleep) (int which_clock, int flags, struct timespec * t); int (*timer_set) (struct k_itimer * timr, int flags, @@ -48,13 +47,13 @@ struct k_clock { void register_posix_clock(int clock_id, struct k_clock *new_clock); /* Error handlers for timer_create, nanosleep and settime */ -int do_posix_clock_notimer_create(int which_clock, - struct sigevent __user *time_event_spec, - timer_t __user *created_timer_id); - +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); +/* function to call to trigger timer event */ +int posix_timer_event(struct k_itimer *timr, int si_private); + struct now_struct { unsigned long jiffies; }; |
