diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2007-02-16 04:27:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-16 11:13:57 -0500 |
commit | 5d8b34fdcb384161552d01ee8f34af5ff11f9684 (patch) | |
tree | 7052d50574d747b7ec2172051adf8126074d6982 /include | |
parent | 7e69f2b1ead2a4c51c12817f18263ff0e59335a6 (diff) |
[PATCH] clocksource: Add verification (watchdog) helper
The TSC needs to be verified against another clocksource. Instead of using
hardwired assumptions of available hardware, provide a generic verification
mechanism. The verification uses the best available clocksource and handles
the usability for high resolution timers / dynticks of the clocksource which
needs to be verified.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/clocksource.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index a585a29fe7c4..830a250ecf94 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -12,11 +12,13 @@ | |||
12 | #include <linux/timex.h> | 12 | #include <linux/timex.h> |
13 | #include <linux/time.h> | 13 | #include <linux/time.h> |
14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
15 | #include <linux/timer.h> | ||
15 | #include <asm/div64.h> | 16 | #include <asm/div64.h> |
16 | #include <asm/io.h> | 17 | #include <asm/io.h> |
17 | 18 | ||
18 | /* clocksource cycle base type */ | 19 | /* clocksource cycle base type */ |
19 | typedef u64 cycle_t; | 20 | typedef u64 cycle_t; |
21 | struct clocksource; | ||
20 | 22 | ||
21 | /** | 23 | /** |
22 | * struct clocksource - hardware abstraction for a free running counter | 24 | * struct clocksource - hardware abstraction for a free running counter |
@@ -62,13 +64,22 @@ struct clocksource { | |||
62 | cycle_t cycle_last, cycle_interval; | 64 | cycle_t cycle_last, cycle_interval; |
63 | u64 xtime_nsec, xtime_interval; | 65 | u64 xtime_nsec, xtime_interval; |
64 | s64 error; | 66 | s64 error; |
67 | |||
68 | #ifdef CONFIG_CLOCKSOURCE_WATCHDOG | ||
69 | /* Watchdog related data, used by the framework */ | ||
70 | struct list_head wd_list; | ||
71 | cycle_t wd_last; | ||
72 | #endif | ||
65 | }; | 73 | }; |
66 | 74 | ||
67 | /* | 75 | /* |
68 | * Clock source flags bits:: | 76 | * Clock source flags bits:: |
69 | */ | 77 | */ |
70 | #define CLOCK_SOURCE_IS_CONTINUOUS 0x01 | 78 | #define CLOCK_SOURCE_IS_CONTINUOUS 0x01 |
71 | #define CLOCK_SOURCE_MUST_VERIFY 0x02 | 79 | #define CLOCK_SOURCE_MUST_VERIFY 0x02 |
80 | |||
81 | #define CLOCK_SOURCE_WATCHDOG 0x10 | ||
82 | #define CLOCK_SOURCE_VALID_FOR_HRES 0x20 | ||
72 | 83 | ||
73 | /* simplify initialization of mask field */ | 84 | /* simplify initialization of mask field */ |
74 | #define CLOCKSOURCE_MASK(bits) (cycle_t)(bits<64 ? ((1ULL<<bits)-1) : -1) | 85 | #define CLOCKSOURCE_MASK(bits) (cycle_t)(bits<64 ? ((1ULL<<bits)-1) : -1) |