summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-03-29 16:34:02 -0700
committerChromeBot <chrome-bot@google.com>2013-04-02 14:12:55 -0700
commit5966f22a8a1928583943b57fc22e72f85d69d079 (patch)
treee49232c6d5368219faa63cae0ec5e01a4866f837 /core
parent97bf36c9d3ad3d96ad6dea7cd6e6f3e164297c43 (diff)
downloadchrome-ec-5966f22a8a1928583943b57fc22e72f85d69d079.tar.gz
Add support for calling deferred functions
This is a cleaner way of deferring work from interrupt-time to task-time without requiring a task for each module which needs this. Replaces/supersedes delayed hook notification, which didn't scale well (since every function would have needed to be its own hook type). BUG=chrome-os-partner:18473 BRANCH=none TEST=boot system. plug/unplug AC power; notifies the host properly Change-Id: I50263fe1ce37e74c1ef8db3671379098997102ed Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/46953 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m/ec.lds.S4
-rw-r--r--core/cortex-m/link_defs.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index 29e63bf4a6..cb0f38f35a 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -104,6 +104,10 @@ SECTIONS
*(.rodata.HOOK_SECOND)
__hooks_second_end = .;
+ __deferred_funcs = .;
+ *(.rodata.deferred)
+ __deferred_funcs_end = .;
+
. = ALIGN(4);
*(.rodata*)
diff --git a/core/cortex-m/link_defs.h b/core/cortex-m/link_defs.h
index 2b5a4a4d77..dbf2757b21 100644
--- a/core/cortex-m/link_defs.h
+++ b/core/cortex-m/link_defs.h
@@ -43,6 +43,11 @@ extern const struct hook_data __hooks_tick_end[];
extern const struct hook_data __hooks_second[];
extern const struct hook_data __hooks_second_end[];
+/* Deferrable functions */
+static const struct deferred_data __deferred_funcs[];
+static const struct deferred_data __deferred_funcs_end[];
+
+
/* Host commands */
extern const struct host_command __hcmds[];
extern const struct host_command __hcmds_end[];