protect: move us_heap to userspace_data_s

Refactor heap pointer storage by moving us_heap field from userspace_s
to the nested userspace_data_s structure, enabling future extensibility
of user-space data without modifying the core userspace_s interface across
all board-specific implementations.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5
2025-09-05 16:26:05 +08:00
committed by Xiang Xiao
parent 03d9d78adf
commit 5db4278173
48 changed files with 494 additions and 93 deletions
@@ -45,6 +45,15 @@
# error "CONFIG_NUTTX_USERSPACE not defined"
#endif
/****************************************************************************
* Private Data
****************************************************************************/
static struct userspace_data_s g_userspace_data =
{
.us_heap = &g_mmheap,
};
/****************************************************************************
* Public Data
****************************************************************************/
@@ -76,9 +85,9 @@ const struct userspace_s userspace locate_data(".userspace") =
.us_heapend = (uintptr_t)__ld_udram_end,
/* Memory manager heap structure */
/* User data memory structure */
.us_heap = &g_mmheap,
.us_data = &g_userspace_data,
/* Task/thread startup routines */
@@ -45,6 +45,15 @@
# error "CONFIG_NUTTX_USERSPACE not defined"
#endif
/****************************************************************************
* Private Data
****************************************************************************/
static struct userspace_data_s g_userspace_data =
{
.us_heap = &g_mmheap,
};
/****************************************************************************
* Public Data
****************************************************************************/
@@ -76,9 +85,9 @@ const struct userspace_s userspace locate_data(".userspace") =
.us_heapend = (uintptr_t)__ld_udram_end,
/* Memory manager heap structure */
/* User data memory structure */
.us_heap = &g_mmheap,
.us_data = &g_userspace_data,
/* Task/thread startup routines */