diff options
Diffstat (limited to 'arch/arm/kernel/time.c')
-rw-r--r-- | arch/arm/kernel/time.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index fe31b22f18fd..af2afb019672 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c | |||
@@ -110,6 +110,42 @@ void timer_tick(void) | |||
110 | } | 110 | } |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | static void dummy_clock_access(struct timespec *ts) | ||
114 | { | ||
115 | ts->tv_sec = 0; | ||
116 | ts->tv_nsec = 0; | ||
117 | } | ||
118 | |||
119 | static clock_access_fn __read_persistent_clock = dummy_clock_access; | ||
120 | static clock_access_fn __read_boot_clock = dummy_clock_access;; | ||
121 | |||
122 | void read_persistent_clock(struct timespec *ts) | ||
123 | { | ||
124 | __read_persistent_clock(ts); | ||
125 | } | ||
126 | |||
127 | void read_boot_clock(struct timespec *ts) | ||
128 | { | ||
129 | __read_boot_clock(ts); | ||
130 | } | ||
131 | |||
132 | int __init register_persistent_clock(clock_access_fn read_boot, | ||
133 | clock_access_fn read_persistent) | ||
134 | { | ||
135 | /* Only allow the clockaccess functions to be registered once */ | ||
136 | if (__read_persistent_clock == dummy_clock_access && | ||
137 | __read_boot_clock == dummy_clock_access) { | ||
138 | if (read_boot) | ||
139 | __read_boot_clock = read_boot; | ||
140 | if (read_persistent) | ||
141 | __read_persistent_clock = read_persistent; | ||
142 | |||
143 | return 0; | ||
144 | } | ||
145 | |||
146 | return -EINVAL; | ||
147 | } | ||
148 | |||
113 | #if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS) | 149 | #if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS) |
114 | static int timer_suspend(void) | 150 | static int timer_suspend(void) |
115 | { | 151 | { |