mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +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:
@@ -62,7 +62,7 @@
|
||||
* structure from the userspace interface.
|
||||
*/
|
||||
|
||||
# define UMM_HEAP(i) ((struct mm_heap_s *const *)USERSPACE->us_heap)[i]
|
||||
# define UMM_HEAP(i) ((struct mm_heap_s *const *)USERSPACE_HEAP)[i]
|
||||
|
||||
#else
|
||||
/* Otherwise, the user heap data structures are in common .bss */
|
||||
|
||||
@@ -179,7 +179,7 @@ void up_allocate_heap(void **heap_start, size_t *heap_size)
|
||||
|
||||
#ifdef CONFIG_BUILD_PROTECTED
|
||||
struct mm_heap_s *const *heap =
|
||||
(struct mm_heap_s *const *)USERSPACE->us_heap;
|
||||
(struct mm_heap_s *const *)USERSPACE_HEAP;
|
||||
void *const *bssend = (void *const *)USERSPACE->us_bssend;
|
||||
void *const *heapend = (void *const *)USERSPACE->us_heapend;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user