diff options
author | Carl Hamilton <carlh@chromium.org> | 2017-01-10 08:20:53 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-01-11 14:46:18 -0800 |
commit | a1ca00d1574bf8eba48fd118dada4d7914bef8d1 (patch) | |
tree | a1ebe5853cb032e9cba58e341103b09e433cc650 | |
parent | dabc580d7e421e5bb3eb115b72d75dffa268604d (diff) | |
download | chrome-ec-a1ca00d1574bf8eba48fd118dada4d7914bef8d1.tar.gz |
ec: Minor cleanup of private host command macros.
* Rename PRIVATE_HOST_COMMAND_VALUE to EC_PRIVATE_HOST_COMMAND_VALUE to
make it clear it is part of EC and reduce the likelihood of collisions.
* Move PRIVATE_HOST_COMMAND_VALUE macro to ec_commands.h. This reduces the
transitive dependencies required to determine the value of a private host
command. This is beneficial for code outside of the ChromiumOS build
environment that needs to send private commands to an EC.
* Define DECLARE_PRIVATE_HOST_COMMAND when there is no host command task.
This will prevent builds with private commands from failing when the host
command task is not configured.
BUG=chromium:570895
BRANCH=none
TEST=make -j buildall
Change-Id: Iad938cb6a1521b65e4f893439d592ef375caace9
Reviewed-on: https://chromium-review.googlesource.com/426737
Commit-Ready: Carl Hamilton <carlh@chromium.org>
Tested-by: Carl Hamilton <carlh@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | include/ec_commands.h | 7 | ||||
-rw-r--r-- | include/host_command.h | 15 |
2 files changed, 13 insertions, 9 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 6ea1a74c15..b63ae327fd 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -4022,6 +4022,13 @@ struct __ec_align1 ec_response_usb_pd_mux_info { #define EC_CMD_BOARD_SPECIFIC_BASE 0x3E00 #define EC_CMD_BOARD_SPECIFIC_LAST 0x3FFF +/* + * Given the private host command offset, calculate the true private host + * command value. + */ +#define EC_PRIVATE_HOST_COMMAND_VALUE(command) \ + (EC_CMD_BOARD_SPECIFIC_BASE + (command)) + /*****************************************************************************/ /* * Passthru commands diff --git a/include/host_command.h b/include/host_command.h index 101e73c693..acaa2a4f6b 100644 --- a/include/host_command.h +++ b/include/host_command.h @@ -218,18 +218,15 @@ void host_packet_receive(struct host_packet *pkt); EXPAND(EC_CMD_BOARD_SPECIFIC_BASE, command) \ __attribute__((section(".rodata.hcmds."\ EXPANDSTR(EC_CMD_BOARD_SPECIFIC_BASE, command)))) \ - = {routine, EC_CMD_BOARD_SPECIFIC_BASE + command, version_mask} - -/* - * Given the private host command offset, calculate - * the true private host command value. - */ -#define PRIVATE_HOST_COMMAND_VALUE(command) \ - (EC_CMD_BOARD_SPECIFIC_BASE + command) + = {routine, EC_PRIVATE_HOST_COMMAND_VALUE(command), \ + version_mask} #else #define DECLARE_HOST_COMMAND(command, routine, version_mask) \ int (routine)(struct host_cmd_handler_args *args) \ - __attribute__((unused)) + __attribute__((unused)) + +#define DECLARE_PRIVATE_HOST_COMMAND(command, routine, version_mask) \ + DECLARE_HOST_COMMAND(command, routine, version_mask) #endif /** |