summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ec_commands.h7
-rw-r--r--include/host_command.h15
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
/**