summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-30 13:01:55 -0700
committerGerrit <chrome-bot@google.com>2012-10-30 15:33:25 -0700
commit433f98c6b67e23641f9808e6ca6effc4285dd42e (patch)
tree2852e69a904cba0ffbe1ca541d721169a054f653 /core
parent8b3a242ff0b8398b37378c67fe2c63beec1fa827 (diff)
downloadchrome-ec-433f98c6b67e23641f9808e6ca6effc4285dd42e.tar.gz
Add per-second hook
PWM and temp sensor monitoring want to happen every second, vs. several times a second for watchdog and LPC. This is still considerably simpler than having tick functions declare an interval at which they want to be called, which would require a RAM-based array of pending tick functions and alarm times. If you need that level of complexity, you still need a task. BUG=chrome-os-partner:15714 BRANCH=none TEST=temporarily add HOOK_TICK and HOOK_SECOND hooks and see that on LM4, HOOK_TICK is called 4x a second and HOOK_SECOND is called every second. Change-Id: I5c09842fd356d3254021486949b2799142068b4f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36938 Commit-Ready: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m/ec.lds.S4
-rw-r--r--core/cortex-m/link_defs.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index 7097ced5a5..29e63bf4a6 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -100,6 +100,10 @@ SECTIONS
*(.rodata.HOOK_TICK)
__hooks_tick_end = .;
+ __hooks_second = .;
+ *(.rodata.HOOK_SECOND)
+ __hooks_second_end = .;
+
. = ALIGN(4);
*(.rodata*)
diff --git a/core/cortex-m/link_defs.h b/core/cortex-m/link_defs.h
index 44332c74bc..2b5a4a4d77 100644
--- a/core/cortex-m/link_defs.h
+++ b/core/cortex-m/link_defs.h
@@ -40,6 +40,8 @@ extern const struct hook_data __hooks_lid_change[];
extern const struct hook_data __hooks_lid_change_end[];
extern const struct hook_data __hooks_tick[];
extern const struct hook_data __hooks_tick_end[];
+extern const struct hook_data __hooks_second[];
+extern const struct hook_data __hooks_second_end[];
/* Host commands */
extern const struct host_command __hcmds[];