Skip to content

Commit d59b2a2

Browse files
peter-mitsisnashif
authored andcommitted
sys: sys_heap: Fix _system_heap type
Changes the type used in _system_heap extern declarations to use k_heap instead of sys_heap. Fixes #100530 Signed-off-by: Peter Mitsis <[email protected]>
1 parent e82a8a6 commit d59b2a2

File tree

3 files changed

+7
-8
lines changed
  • modules/nrf_wifi/os
  • samples/subsys/zbus/msg_subscriber/src
  • subsys/shell/modules/kernel_service

3 files changed

+7
-8
lines changed

modules/nrf_wifi/os/shim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LOG_MODULE_REGISTER(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL);
3737
/* Memory pool management - unified pool-based API */
3838
#if defined(CONFIG_NRF_WIFI_GLOBAL_HEAP)
3939
/* Use global system heap */
40-
extern struct sys_heap _system_heap;
40+
extern struct k_heap _system_heap;
4141
static struct k_heap * const wifi_ctrl_pool = &_system_heap;
4242
static struct k_heap * const wifi_data_pool = &_system_heap;
4343
#else

samples/subsys/zbus/msg_subscriber/src/main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <zephyr/zbus/zbus.h>
1010
LOG_MODULE_REGISTER(sample, CONFIG_LOG_MAX_LEVEL);
1111

12-
extern struct sys_heap _system_heap;
12+
extern struct k_heap _system_heap;
1313
static size_t total_allocated;
1414

1515
void on_heap_alloc(uintptr_t heap_id, void *mem, size_t bytes)
@@ -28,10 +28,11 @@ void on_heap_free(uintptr_t heap_id, void *mem, size_t bytes)
2828

2929
#if defined(CONFIG_ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC)
3030

31-
HEAP_LISTENER_ALLOC_DEFINE(my_heap_listener_alloc, HEAP_ID_FROM_POINTER(&_system_heap),
31+
HEAP_LISTENER_ALLOC_DEFINE(my_heap_listener_alloc, HEAP_ID_FROM_POINTER(&_system_heap.heap),
3232
on_heap_alloc);
3333

34-
HEAP_LISTENER_FREE_DEFINE(my_heap_listener_free, HEAP_ID_FROM_POINTER(&_system_heap), on_heap_free);
34+
HEAP_LISTENER_FREE_DEFINE(my_heap_listener_free, HEAP_ID_FROM_POINTER(&_system_heap.heap),
35+
on_heap_free);
3536

3637
#endif /* CONFIG_ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC */
3738
struct acc_msg {

subsys/shell/modules/kernel_service/heap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
#if K_HEAP_MEM_POOL_SIZE > 0
99
#include "kernel_shell.h"
1010

11-
#include <zephyr/sys/sys_heap.h>
12-
13-
extern struct sys_heap _system_heap;
11+
extern struct k_heap _system_heap;
1412

1513
static int cmd_kernel_heap(const struct shell *sh, size_t argc, char **argv)
1614
{
@@ -20,7 +18,7 @@ static int cmd_kernel_heap(const struct shell *sh, size_t argc, char **argv)
2018
int err;
2119
struct sys_memory_stats stats;
2220

23-
err = sys_heap_runtime_stats_get(&_system_heap, &stats);
21+
err = sys_heap_runtime_stats_get(&_system_heap.heap, &stats);
2422
if (err) {
2523
shell_error(sh, "Failed to read kernel system heap statistics (err %d)", err);
2624
return -ENOEXEC;

0 commit comments

Comments
 (0)