Skip to content

Commit f02c612

Browse files
niedzwiecki-dawidjhedberg
authored andcommitted
mgmt: ec_host_cmd: align buffers
Align the rx and tx buffers to prevent unaligned access. Signed-off-by: Dawid Niedzwiecki <[email protected]>
1 parent 254c671 commit f02c612

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ BUILD_ASSERT(NUMBER_OF_CHOSEN_BACKENDS < 2, "Number of chosen backends > 1");
3333
#define TX_HEADER_SIZE (sizeof(struct ec_host_cmd_response_header))
3434

3535
COND_CODE_1(CONFIG_EC_HOST_CMD_HANDLER_RX_BUFFER_DEF,
36-
(static uint8_t hc_rx_buffer[CONFIG_EC_HOST_CMD_HANDLER_RX_BUFFER_SIZE];), ())
36+
(static uint8_t hc_rx_buffer[CONFIG_EC_HOST_CMD_HANDLER_RX_BUFFER_SIZE] __aligned(4);),
37+
())
3738
COND_CODE_1(CONFIG_EC_HOST_CMD_HANDLER_TX_BUFFER_DEF,
38-
(static uint8_t hc_tx_buffer[CONFIG_EC_HOST_CMD_HANDLER_TX_BUFFER_SIZE];), ())
39+
(static uint8_t hc_tx_buffer[CONFIG_EC_HOST_CMD_HANDLER_TX_BUFFER_SIZE] __aligned(4);),
40+
())
3941

4042
#ifdef CONFIG_EC_HOST_CMD_DEDICATED_THREAD
4143
static K_KERNEL_STACK_DEFINE(hc_stack, CONFIG_EC_HOST_CMD_HANDLER_STACK_SIZE);

0 commit comments

Comments
 (0)