mm: Enable a dedicated kernel heap on BUILD_FLAT via MM_KERNEL_HEAP

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
Gustavo Henrique Nihei
2023-01-11 15:32:05 -03:00
committed by Xiang Xiao
parent 047f7f8d3a
commit a3e253b4a3
5 changed files with 34 additions and 15 deletions
+3
View File
@@ -644,6 +644,9 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size);
* as determined by CONFIG_MM_KERNEL_HEAP=y. This function allocates (and
* protects) the kernel-space heap.
*
* For Flat build (CONFIG_BUILD_FLAT=y), this function enables a separate
* (although unprotected) heap for the kernel.
*
****************************************************************************/
#ifdef CONFIG_MM_KERNEL_HEAP
+9 -3
View File
@@ -86,10 +86,16 @@
# define MM_KERNEL_USRHEAP_INIT 1
#endif
/* The kernel heap is never accessible from user code */
/* When building the Userspace image under CONFIG_BUILD_KERNEL or
* CONFIG_BUILD_PROTECTED (i.e. !defined(__KERNEL__)), CONFIG_MM_KERNEL_HEAP
* must be undefined to ensure the kernel heap is never accessible from user
* code.
*/
#ifndef __KERNEL__
# undef CONFIG_MM_KERNEL_HEAP
#if defined(CONFIG_BUILD_KERNEL) || defined(CONFIG_BUILD_PROTECTED)
# ifndef __KERNEL__
# undef CONFIG_MM_KERNEL_HEAP
# endif
#endif
/****************************************************************************