summaryrefslogtreecommitdiff
path: root/include/host_command.h
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2015-12-17 13:08:38 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-12-18 12:43:50 -0800
commitee4e0763a17908c9cb058bfadaab0ac803062e18 (patch)
treec827254a14728fa81d0a4d3181c5db2a02629727 /include/host_command.h
parent8623942335252b7ec92d587391403ff9f425a007 (diff)
downloadchrome-ec-ee4e0763a17908c9cb058bfadaab0ac803062e18.tar.gz
common: Include host/console commands based on HAS_TASK_HOSTCMD/CONSOLE
Don't build a table of host / console commands if the HOSTCMD or CONSOLE task is not present. This saves space in the .hcmds / .cmds section and allows the linker to prune command handler functions which will never be called. BUG=chrome-os-partner:41959 TEST=Verify ec.RO.flat shrinks on snoball and glados_pd, and remains the same size on chell and samus. Also verify basic functions are still working on snoball and glados_pd. BRANCH=None Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I79975c18ec1d87fedda8d1f299f30ffc43c24f69 Reviewed-on: https://chromium-review.googlesource.com/319112 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include/host_command.h')
-rw-r--r--include/host_command.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/host_command.h b/include/host_command.h
index c987df561b..c9dcd3ddd8 100644
--- a/include/host_command.h
+++ b/include/host_command.h
@@ -194,10 +194,16 @@ int host_request_expected_size(const struct ec_host_request *r);
void host_packet_receive(struct host_packet *pkt);
/* Register a host command handler */
+#ifdef HAS_TASK_HOSTCMD
#define DECLARE_HOST_COMMAND(command, routine, version_mask) \
const struct host_command __keep __host_cmd_##command \
__attribute__((section(".rodata.hcmds"))) \
= {routine, command, version_mask}
+#else
+#define DECLARE_HOST_COMMAND(command, routine, version_mask) \
+ int (routine)(struct host_cmd_handler_args *args) \
+ __attribute__((unused))
+#endif
/**