Skip to content

Commit f3453bd

Browse files
committed
wifi: fix internal malloc wrappers reference
Wi-Fi adapter internal wrappers must allocate buffers from the main heap (internal RAM) and never from SPIRAM. This change updates all adapter files to make consistent approach. Signed-off-by: Sylvio Alves <[email protected]>
1 parent 3339ff2 commit f3453bd

File tree

10 files changed

+15
-15
lines changed

10 files changed

+15
-15
lines changed

zephyr/esp32/src/coex/esp_coex_adapter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void IRAM_ATTR esp_coex_common_timer_arm_us_wrapper(void *ptimer, uint32_t us, b
126126

127127
void *IRAM_ATTR esp_coex_common_malloc_internal_wrapper(size_t size)
128128
{
129-
return wifi_malloc(size);
129+
return k_malloc(size);
130130
}
131131

132132
static int32_t IRAM_ATTR esp_coex_internal_semphr_take_from_isr_wrapper(void *semphr, void *hptw)

zephyr/esp32/src/wifi/esp_wifi_adapter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,12 @@ static void *IRAM_ATTR realloc_internal_wrapper(void *ptr, size_t size)
355355

356356
static void *IRAM_ATTR calloc_internal_wrapper(size_t n, size_t size)
357357
{
358-
return wifi_calloc(n, size);
358+
return k_calloc(n, size);
359359
}
360360

361361
static void *IRAM_ATTR zalloc_internal_wrapper(size_t size)
362362
{
363-
return wifi_calloc(1, size);
363+
return k_calloc(1, size);
364364
}
365365

366366
uint32_t uxQueueMessagesWaiting(void *queue)

zephyr/esp32c2/src/coex/esp_coex_adapter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void IRAM_ATTR esp_coex_common_timer_arm_us_wrapper(void *ptimer, uint32_t us, b
122122

123123
void *IRAM_ATTR esp_coex_common_malloc_internal_wrapper(size_t size)
124124
{
125-
return wifi_malloc(size);
125+
return k_malloc(size);
126126
}
127127

128128
uint32_t esp_coex_common_clk_slowclk_cal_get_wrapper(void)

zephyr/esp32c2/src/wifi/esp_wifi_adapter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,12 @@ static void *IRAM_ATTR realloc_internal_wrapper(void *ptr, size_t size)
374374

375375
static void *IRAM_ATTR calloc_internal_wrapper(size_t n, size_t size)
376376
{
377-
return wifi_calloc(n, size);
377+
return k_calloc(n, size);
378378
}
379379

380380
static void *IRAM_ATTR zalloc_internal_wrapper(size_t size)
381381
{
382-
return wifi_calloc(1, size);
382+
return k_calloc(1, size);
383383
}
384384

385385
uint32_t uxQueueMessagesWaiting(void *queue)

zephyr/esp32c3/src/coex/esp_coex_adapter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void IRAM_ATTR esp_coex_common_timer_arm_us_wrapper(void *ptimer, uint32_t us, b
127127

128128
void *IRAM_ATTR esp_coex_common_malloc_internal_wrapper(size_t size)
129129
{
130-
return wifi_malloc(size);
130+
return k_malloc(size);
131131
}
132132

133133
uint32_t esp_coex_common_clk_slowclk_cal_get_wrapper(void)

zephyr/esp32c3/src/wifi/esp_wifi_adapter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,12 @@ static void *IRAM_ATTR realloc_internal_wrapper(void *ptr, size_t size)
374374

375375
static void *IRAM_ATTR calloc_internal_wrapper(size_t n, size_t size)
376376
{
377-
return wifi_calloc(n, size);
377+
return k_calloc(n, size);
378378
}
379379

380380
static void *IRAM_ATTR zalloc_internal_wrapper(size_t size)
381381
{
382-
return wifi_calloc(1, size);
382+
return k_calloc(1, size);
383383
}
384384

385385
uint32_t uxQueueMessagesWaiting(void *queue)

zephyr/esp32c6/src/coex/esp_coex_adapter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void IRAM_ATTR esp_coex_common_timer_arm_us_wrapper(void *ptimer, uint32_t us, b
127127

128128
void *IRAM_ATTR esp_coex_common_malloc_internal_wrapper(size_t size)
129129
{
130-
return wifi_malloc(size);
130+
return k_malloc(size);
131131
}
132132

133133
uint32_t esp_coex_common_clk_slowclk_cal_get_wrapper(void)

zephyr/esp32c6/src/wifi/esp_wifi_adapter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,12 @@ static void *IRAM_ATTR realloc_internal_wrapper(void *ptr, size_t size)
378378

379379
static void *IRAM_ATTR calloc_internal_wrapper(size_t n, size_t size)
380380
{
381-
return wifi_calloc(n, size);
381+
return k_calloc(n, size);
382382
}
383383

384384
static void *IRAM_ATTR zalloc_internal_wrapper(size_t size)
385385
{
386-
return wifi_calloc(1, size);
386+
return k_calloc(1, size);
387387
}
388388

389389
uint32_t uxQueueMessagesWaiting(void *queue)

zephyr/esp32s2/src/coex/esp_coex_adapter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void IRAM_ATTR esp_coex_common_timer_arm_us_wrapper(void *ptimer, uint32_t us, b
168168

169169
void *IRAM_ATTR esp_coex_common_malloc_internal_wrapper(size_t size)
170170
{
171-
return wifi_malloc(size);
171+
return k_malloc(size);
172172
}
173173

174174
uint32_t esp_coex_common_clk_slowclk_cal_get_wrapper(void)

zephyr/esp32s2/src/wifi/esp_wifi_adapter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,12 @@ static void *IRAM_ATTR realloc_internal_wrapper(void *ptr, size_t size)
356356

357357
static void *IRAM_ATTR calloc_internal_wrapper(size_t n, size_t size)
358358
{
359-
return wifi_calloc(n, size);
359+
return k_calloc(n, size);
360360
}
361361

362362
static void *IRAM_ATTR zalloc_internal_wrapper(size_t size)
363363
{
364-
return wifi_calloc(1, size);
364+
return k_calloc(1, size);
365365
}
366366

367367
uint32_t uxQueueMessagesWaiting(void *queue)

0 commit comments

Comments
 (0)