diff options
author | Richard Cochran <richardcochran@gmail.com> | 2011-02-01 08:52:35 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-02 09:28:20 -0500 |
commit | 0606f422b453f76c31ab2b1bd52943ff06a2dcf2 (patch) | |
tree | 14f4859e8492f01e97140248a28ab98355c415cf /kernel/posix-timers.c | |
parent | 527087374faa488776a789375a7d6ea74fda6f71 (diff) |
posix clocks: Introduce dynamic clocks
This patch adds support for adding and removing posix clocks. The
clock lifetime cycle is patterned after usb devices. Each clock is
represented by a standard character device. In addition, the driver
may optionally implement custom character device operations.
The posix clock and timer system calls listed below now work with
dynamic posix clocks, as well as the traditional static clocks.
The following system calls are affected:
- clock_adjtime (brand new syscall)
- clock_gettime
- clock_getres
- clock_settime
- timer_create
- timer_delete
- timer_gettime
- timer_settime
[ tglx: Adapted to the posix-timer cleanup. Moved clock_posix_dynamic
to posix-clock.c and made all referenced functions static ]
Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Acked-by: John Stultz <johnstul@us.ibm.com>
LKML-Reference: <20110201134420.164172635@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r-- | kernel/posix-timers.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index af936fd37140..44fcff131b38 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/init.h> | 41 | #include <linux/init.h> |
42 | #include <linux/compiler.h> | 42 | #include <linux/compiler.h> |
43 | #include <linux/idr.h> | 43 | #include <linux/idr.h> |
44 | #include <linux/posix-clock.h> | ||
44 | #include <linux/posix-timers.h> | 45 | #include <linux/posix-timers.h> |
45 | #include <linux/syscalls.h> | 46 | #include <linux/syscalls.h> |
46 | #include <linux/wait.h> | 47 | #include <linux/wait.h> |
@@ -489,7 +490,8 @@ static void release_posix_timer(struct k_itimer *tmr, int it_id_set) | |||
489 | static struct k_clock *clockid_to_kclock(const clockid_t id) | 490 | static struct k_clock *clockid_to_kclock(const clockid_t id) |
490 | { | 491 | { |
491 | if (id < 0) | 492 | if (id < 0) |
492 | return (id & CLOCKFD_MASK) == CLOCKFD ? NULL : &clock_posix_cpu; | 493 | return (id & CLOCKFD_MASK) == CLOCKFD ? |
494 | &clock_posix_dynamic : &clock_posix_cpu; | ||
493 | 495 | ||
494 | if (id >= MAX_CLOCKS || !posix_clocks[id].clock_getres) | 496 | if (id >= MAX_CLOCKS || !posix_clocks[id].clock_getres) |
495 | return NULL; | 497 | return NULL; |