From a3bbfb37e8d43960371299484b4a0b29690c8f18 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Mon, 25 Oct 2004 04:22:46 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/posix-timers.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'include/linux') 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; }; -- cgit v1.2.3