diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-08-05 20:47:54 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-08-06 18:55:00 -0700 |
commit | dbc861c5f0115ec673be2a7c6837d19dc9e3c4c1 (patch) | |
tree | 5f1082ee2e4c0a6bc7e75c70ea42a92c1cd5dcd7 /include/timer.h | |
parent | d8e04f0db75a0088121981df3bd57c3dccb10945 (diff) | |
download | chrome-ec-dbc861c5f0115ec673be2a7c6837d19dc9e3c4c1.tar.gz |
add a function to fast forward system timer
When we wake up from a deep sleep mode, the system timer clock might
have been stopped. We need to be able to set using another time source
(e.g. the RTC).
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:8866
TEST=make BOARD=snow && make BOARD=link
on Snow, on a software implementing STOP mode, check the system time is
still accurate by comparing it to the wall clock.
Change-Id: Ieddbb423d052c7aceb398470866b25b25a74c0a0
Reviewed-on: https://gerrit.chromium.org/gerrit/29314
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/timer.h')
-rw-r--r-- | include/timer.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/timer.h b/include/timer.h index d3a4989e05..0a4273ff25 100644 --- a/include/timer.h +++ b/include/timer.h @@ -53,6 +53,14 @@ void usleep(unsigned us); /* Get the current timestamp from the system timer. */ timestamp_t get_time(void); +/* Force the current value of the system timer. + * + * This function is for the power management implementation which wants to fix + * the system time when waking up from a mode with clocks turned off. + * Note: must be called with interrupts disabled. + */ +void force_time(timestamp_t ts); + /* Print the current timer information using the command output channel. This * may be called from interrupt level. */ void timer_print_info(void); |