Skip to content

Commit 5530ea0

Browse files
Andries Kruithofcarlescufi
authored andcommitted
Bluetooth: controller: ensure memory access is aligned
The memory used for Tx buffers and procedure context must be aligned on a word boundary, otherwise it is possible to get unaligned memory access Signed-off-by: Andries Kruithof <[email protected]>
1 parent 1d879b9 commit 5530ea0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

subsys/bluetooth/controller/ll_sw/ull_llcp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ sys_slist_t tx_buffer_wait_list;
6060
static uint8_t common_tx_buffer_alloc;
6161
#endif /* LLCP_TX_CTRL_BUF_QUEUE_ENABLE */
6262

63-
static uint8_t buffer_mem_tx[TX_CTRL_BUF_SIZE * LLCP_TX_CTRL_BUF_COUNT];
63+
static uint8_t MALIGN(4) buffer_mem_tx[TX_CTRL_BUF_SIZE * LLCP_TX_CTRL_BUF_COUNT];
6464
static struct llcp_mem_pool mem_tx = { .pool = buffer_mem_tx };
6565

66-
static uint8_t buffer_mem_local_ctx[PROC_CTX_BUF_SIZE *
66+
static uint8_t MALIGN(4) buffer_mem_local_ctx[PROC_CTX_BUF_SIZE *
6767
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM];
6868
static struct llcp_mem_pool mem_local_ctx = { .pool = buffer_mem_local_ctx };
6969

70-
static uint8_t buffer_mem_remote_ctx[PROC_CTX_BUF_SIZE *
70+
static uint8_t MALIGN(4) buffer_mem_remote_ctx[PROC_CTX_BUF_SIZE *
7171
CONFIG_BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM];
7272
static struct llcp_mem_pool mem_remote_ctx = { .pool = buffer_mem_remote_ctx };
7373

0 commit comments

Comments
 (0)