mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 18:58:27 +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:
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user