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
2026-02-02 11:06:53 +08:00
committed by Xiang Xiao
parent 03d9d78adf
commit 5db4278173
48 changed files with 494 additions and 93 deletions
+1 -1
View File
@@ -124,7 +124,7 @@
* structure from the userspace interface.
*/
# define USR_HEAP (*USERSPACE->us_heap)
# define USR_HEAP (*USERSPACE->us_data->us_heap)
#else
/* Otherwise, the user heap data structures are in common .bss */
+7 -2
View File
@@ -77,6 +77,11 @@
struct mm_heap_s; /* Forward reference */
struct userspace_data_s
{
FAR struct mm_heap_s **us_heap;
};
/* Every user-space blob starts with a header that provides information about
* the blob. The form of that header is provided by struct userspace_s. An
* instance of this is expected to reside at CONFIG_NUTTX_USERSPACE.
@@ -96,9 +101,9 @@ struct userspace_s
uintptr_t us_bssend;
uintptr_t us_heapend;
/* Memory manager heap structure */
/* User data memory structure */
FAR struct mm_heap_s **us_heap;
FAR struct userspace_data_s *us_data;
/* Task startup routine */