diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-15 09:58:33 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-15 09:58:33 -0700 |
commit | 3f27c0d2a469673e0f1efc8004b6f42428aa5b94 (patch) | |
tree | 548c975cabdcafcac92992d24410ae0a8334dff5 /kernel/time/tick-oneshot.c | |
parent | 9aaa630503f20461bee65ebc4fd87ba8d7a2bd2c (diff) | |
parent | cd6d95d8449b7c9f415f26041e9ae173d387b6bd (diff) | |
download | linux-3f27c0d2a469673e0f1efc8004b6f42428aa5b94.tar.bz2 |
Merge branch 'timers-for-linus-clocksource' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus-clocksource' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
clocksource: prevent selection of low resolution clocksourse also for nohz=on
clocksource: sanity check sysfs clocksource changes
Diffstat (limited to 'kernel/time/tick-oneshot.c')
-rw-r--r-- | kernel/time/tick-oneshot.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/time/tick-oneshot.c b/kernel/time/tick-oneshot.c index 2e8de678e767..a96c0e2b89cf 100644 --- a/kernel/time/tick-oneshot.c +++ b/kernel/time/tick-oneshot.c @@ -128,6 +128,23 @@ int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *)) return 0; } +/** + * tick_check_oneshot_mode - check whether the system is in oneshot mode + * + * returns 1 when either nohz or highres are enabled. otherwise 0. + */ +int tick_oneshot_mode_active(void) +{ + unsigned long flags; + int ret; + + local_irq_save(flags); + ret = __get_cpu_var(tick_cpu_device).mode == TICKDEV_MODE_ONESHOT; + local_irq_restore(flags); + + return ret; +} + #ifdef CONFIG_HIGH_RES_TIMERS /** * tick_init_highres - switch to high resolution mode |