diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 04:27:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:08 -0400 |
commit | 791a644a8d73a9b95515f074afbb3caa0a9964fa (patch) | |
tree | 507b52d335416096b71c078d7af037530403633b /arch/um/kernel/time.c | |
parent | 31ccc1f524b626abcf5e043ad32b881219223c34 (diff) |
uml: clocksource support
Add clocksource support.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/kernel/time.c')
-rw-r--r-- | arch/um/kernel/time.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index 01678487b999..3cb7135e5c47 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c | |||
@@ -97,6 +97,21 @@ static irqreturn_t um_timer(int irq, void *dev) | |||
97 | return IRQ_HANDLED; | 97 | return IRQ_HANDLED; |
98 | } | 98 | } |
99 | 99 | ||
100 | static cycle_t itimer_read(void) | ||
101 | { | ||
102 | return os_nsecs(); | ||
103 | } | ||
104 | |||
105 | static struct clocksource itimer_clocksource = { | ||
106 | .name = "itimer", | ||
107 | .rating = 300, | ||
108 | .read = itimer_read, | ||
109 | .mask = CLOCKSOURCE_MASK(64), | ||
110 | .mult = 1, | ||
111 | .shift = 0, | ||
112 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
113 | }; | ||
114 | |||
100 | static void __init setup_itimer(void) | 115 | static void __init setup_itimer(void) |
101 | { | 116 | { |
102 | int err; | 117 | int err; |
@@ -111,6 +126,11 @@ static void __init setup_itimer(void) | |||
111 | clockevent_delta2ns(60 * HZ, &itimer_clockevent); | 126 | clockevent_delta2ns(60 * HZ, &itimer_clockevent); |
112 | itimer_clockevent.min_delta_ns = | 127 | itimer_clockevent.min_delta_ns = |
113 | clockevent_delta2ns(1, &itimer_clockevent); | 128 | clockevent_delta2ns(1, &itimer_clockevent); |
129 | err = clocksource_register(&itimer_clocksource); | ||
130 | if (err) { | ||
131 | printk(KERN_ERR "clocksource_register returned %d\n", err); | ||
132 | return; | ||
133 | } | ||
114 | clockevents_register_device(&itimer_clockevent); | 134 | clockevents_register_device(&itimer_clockevent); |
115 | } | 135 | } |
116 | 136 | ||