esp32_imm.c: Report the usage with procfs_register_meminfo
This commit is contained in:
parent
73dde4b63b
commit
c51e2a0cb3
@ -25,6 +25,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/fs/procfs.h>
|
||||
#include <nuttx/mm/mm.h>
|
||||
#include <malloc.h>
|
||||
|
||||
@ -58,6 +59,15 @@ void xtensa_imm_initialize(void)
|
||||
start = (FAR void *)&_sheap;
|
||||
size = CONFIG_XTENSA_IMEM_REGION_SIZE;
|
||||
mm_initialize(&g_iheap, start, size);
|
||||
|
||||
#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMINFO)
|
||||
static struct procfs_meminfo_entry_s g_imm_procfs;
|
||||
|
||||
g_imm_procfs.name = "esp32-imem";
|
||||
g_imm_procfs.mallinfo = (void *)mm_mallinfo;
|
||||
g_imm_procfs.user_data = &g_iheap;
|
||||
procfs_register_meminfo(&g_imm_procfs);
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user