mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 05:55:46 +08:00
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:
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user