mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
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:
committed by
Xiang Xiao
parent
047f7f8d3a
commit
a3e253b4a3
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user