diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2015-11-12 16:44:46 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-11-17 14:40:26 -0800 |
commit | a8f2e3625e34b51da381236a14a7d28adc37df4a (patch) | |
tree | 6965c1b45350c11d61bbf560fa0a01162b2de119 /core/cortex-m0 | |
parent | 2d57e6f6d98a06abd55e193b6f5d193280f01988 (diff) | |
download | chrome-ec-a8f2e3625e34b51da381236a14a7d28adc37df4a.tar.gz |
add the 'extension' command framework
This patch introduces a facility which would allow to compile in
callbacks for arbitrary commands passed over various communication
protocols.
Typically this will be used for testing, when various test commands
are multiplexed over an existing protocol.
The callbacks are associated with 16 bit command codes. On input the
callback receives a buffer, containing the command's argument, the
size of the command argument and the maximum size of the buffer. On
output the callback stores processing result in the same buffer and
updates the size to the actual amount of returned data.
Callback descriptors are stored in a dedicated read only section which
is scanned by extension_route_command() to find a callback associated
with a certain command code.
A console channel is also being introduced to allow controlling
console output generated by extension commands handlers.
BRANCH=none
BUG=chrome-os-partner:47524
TEST=none yet
Change-Id: I8ae16a78ca7d72176a5e7f74dd7a232078e7c06c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/312586
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'core/cortex-m0')
-rw-r--r-- | core/cortex-m0/ec.lds.S | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/cortex-m0/ec.lds.S b/core/cortex-m0/ec.lds.S index 10f31953d8..dc36b49f72 100644 --- a/core/cortex-m0/ec.lds.S +++ b/core/cortex-m0/ec.lds.S @@ -65,6 +65,11 @@ SECTIONS __cmds_end = .; . = ALIGN(4); + __extension_cmds = .; + KEEP(*(.rodata.extensioncmds)) + __extension_cmds_end = .; + + . = ALIGN(4); __hcmds = .; KEEP(*(.rodata.hcmds)) __hcmds_end = .; |