summaryrefslogtreecommitdiff
path: root/include/host_command.h
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2016-11-26 01:28:58 +0000
committerVadim Bendebury <vbendeb@chromium.org>2016-11-26 01:29:24 +0000
commitb3a98521228174d58a63d5be6495b4989419e17b (patch)
treec414a4c67861ca527d3036a4bfa8502396e34b9b /include/host_command.h
parent1ece199078c2665b625debd196ca389e5bda58f1 (diff)
downloadchrome-ec-b3a98521228174d58a63d5be6495b4989419e17b.tar.gz
Revert "ec: Improve efficiency of host command dispatcher"
This reverts commit c459c8278ed2dc84100693eab93389a0df9429bd as the fix is not straightforwad, some host command codes in private repos are expressed using C preprecessor which breaks the assumption of this patch that all host commands are expressed as four digit hex numbers. Change-Id: I922de9ae8dbab6eef048463c5c09b1f338152083 Reviewed-on: https://chromium-review.googlesource.com/414492 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'include/host_command.h')
-rw-r--r--include/host_command.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/include/host_command.h b/include/host_command.h
index 52ea73ee53..720492158e 100644
--- a/include/host_command.h
+++ b/include/host_command.h
@@ -197,18 +197,13 @@ void host_packet_receive(struct host_packet *pkt);
/* Register a host command handler */
#ifdef HAS_TASK_HOSTCMD
-#define EXPAND(cmd) __host_cmd_(cmd)
-#define __host_cmd_(cmd) __host_cmd_##cmd
-#define EXPANDSTR(cmd) __host_cmd_str(cmd)
-#define __host_cmd_str(cmd) #cmd
-#define DECLARE_HOST_COMMAND(command, routine, version_mask) \
- const struct host_command __keep EXPAND(command) \
- __attribute__((section(".rodata.hcmds.__host_cmd_" \
- EXPANDSTR(command)))) \
+#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) \
+#define DECLARE_HOST_COMMAND(command, routine, version_mask) \
+ int (routine)(struct host_cmd_handler_args *args) \
__attribute__((unused))
#endif