diff options
Diffstat (limited to 'nuttx/mm/umm_brkaddr.c')
-rw-r--r-- | nuttx/mm/umm_brkaddr.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/nuttx/mm/umm_brkaddr.c b/nuttx/mm/umm_brkaddr.c index dc646f20a..8bf047c56 100644 --- a/nuttx/mm/umm_brkaddr.c +++ b/nuttx/mm/umm_brkaddr.c @@ -43,12 +43,27 @@ #include <nuttx/mm.h> -#ifdef CONFIG_MM_USER_HEAP - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL) +/* In the kernel build, there a multiple user heaps; one for each task + * group. In this build configuration, the user heap structure lies + * in a reserved region at the beginning of the .bss/.data address + * space (CONFIG_ARCH_DATA_VBASE). The size of that region is given by + * ARCH_DATA_RESERVE + */ + +# include <nuttx/addrenv.h> +# define USR_HEAP ((FAR struct mm_heap_s *)CONFIG_ARCH_DATA_VBASE) + +#else +/* Otherwise, the user heap data structures are in common .bss */ + +# define USR_HEAP &g_mmheap; +#endif + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -63,7 +78,5 @@ FAR void *umm_brkaddr(int region) { - return mm_brkaddr(&g_mmheap, region); + return mm_brkaddr(USR_HEAP, region); } - -#endif /* CONFIG_MM_USER_HEAP */ |