mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-17 14:39:55 +00:00
mesh: Fix linux port
It looks like create_free_list() in glue.c requires word aligned blocks which on 64-bit is 8 bytes.
This commit is contained in:
@@ -411,7 +411,7 @@ static inline unsigned int find_msb_set(uint32_t op)
|
||||
|
||||
#define CONFIG_BT_MESH_LPN_GROUPS MYNEWT_VAL(BLE_MESH_LPN_GROUPS)
|
||||
#define CONFIG_BT_MESH_ADV_BUF_COUNT MYNEWT_VAL(BLE_MESH_ADV_BUF_COUNT)
|
||||
#define CONFIG_BT_MESH_SEG_BUFS MYNEWT_VAL(BLE_MESH_SEG_BUFS )
|
||||
#define CONFIG_BT_MESH_SEG_BUFS MYNEWT_VAL(BLE_MESH_SEG_BUFS)
|
||||
#define CONFIG_BT_MESH_FRIEND_QUEUE_SIZE MYNEWT_VAL(BLE_MESH_FRIEND_QUEUE_SIZE)
|
||||
#define CONFIG_BT_MESH_FRIEND_RECV_WIN MYNEWT_VAL(BLE_MESH_FRIEND_RECV_WIN)
|
||||
#define CONFIG_BT_MESH_LPN_POLL_TIMEOUT MYNEWT_VAL(BLE_MESH_LPN_POLL_TIMEOUT)
|
||||
|
||||
@@ -906,6 +906,7 @@ int create_free_list(struct k_mem_slab *slab)
|
||||
uint32_t j;
|
||||
char *p;
|
||||
|
||||
/* blocks must be word aligned */
|
||||
if(((slab->block_size | (uintptr_t)slab->buffer) &
|
||||
(sizeof(void *) - 1)) != 0) {
|
||||
return -EINVAL;
|
||||
|
||||
@@ -113,11 +113,12 @@ static struct seg_rx {
|
||||
struct k_delayed_work ack;
|
||||
} seg_rx[CONFIG_BT_MESH_RX_SEG_MSG_COUNT];
|
||||
|
||||
char _k_mem_slab_buffer_[(BT_MESH_APP_SEG_SDU_MAX*CONFIG_BT_MESH_SEG_BUFS)];
|
||||
|
||||
char _k_mem_slab_buffer_[OS_ALIGN((BT_MESH_APP_SEG_SDU_MAX)*(CONFIG_BT_MESH_SEG_BUFS), OS_ALIGNMENT)];
|
||||
|
||||
struct k_mem_slab segs = {
|
||||
.num_blocks = CONFIG_BT_MESH_SEG_BUFS,
|
||||
.block_size = BT_MESH_APP_SEG_SDU_MAX,
|
||||
.block_size = OS_ALIGN(BT_MESH_APP_SEG_SDU_MAX, OS_ALIGNMENT),
|
||||
.buffer = _k_mem_slab_buffer_,
|
||||
.free_list = NULL,
|
||||
.num_used = 0
|
||||
@@ -1616,7 +1617,7 @@ void bt_mesh_trans_init(void)
|
||||
/* We need to initialize memslab free list here */
|
||||
rc = create_free_list(&segs);
|
||||
if (rc) {
|
||||
BT_ERR("Failed to create free memslab list")
|
||||
BT_ERR("Failed to create free memslab list (error: %d)", rc);
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(seg_tx); i++) {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "os_types.h"
|
||||
|
||||
@@ -30,7 +31,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define BLE_NPL_OS_ALIGNMENT 4
|
||||
#define BLE_NPL_OS_ALIGNMENT (__WORDSIZE / 8)
|
||||
|
||||
#define BLE_NPL_TIME_FOREVER INT32_MAX
|
||||
|
||||
|
||||
Reference in New Issue
Block a user