mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +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
+17
-9
@@ -26,16 +26,24 @@ config MM_CUSTOMIZE_MANAGER
|
||||
endchoice
|
||||
|
||||
config MM_KERNEL_HEAP
|
||||
bool "Support a protected, kernel heap"
|
||||
default y
|
||||
depends on !BUILD_FLAT
|
||||
bool "Kernel dedicated heap"
|
||||
default n if BUILD_FLAT
|
||||
default y if BUILD_PROTECTED || BUILD_KERNEL
|
||||
---help---
|
||||
Partition heap memory into two parts: (1) a protected, kernel-mode
|
||||
heap accessible only by the NuttX kernel, and (2) an unprotected
|
||||
user-mode heap for use by applications. If you are only interested
|
||||
in protected the kernel from read access, then this option is not
|
||||
necessary. If you wish to secure the kernel data as well, then
|
||||
this option should be selected.
|
||||
Under Flat build, this option will enable a separate heap for the kernel.
|
||||
By separating the kernel and userspace heaps, the user is granted more
|
||||
control over the heaps placement within the memory hierarchy, which is
|
||||
specially useful for microcontrollers that provide External RAM.
|
||||
Besides segregating the kernel and userspace allocations, this feature
|
||||
does not prevent the userspace from accessing the kernel heap.
|
||||
|
||||
As for Protected and Kernel builds, this feature partitions heap memory
|
||||
into two parts:
|
||||
(1) a protected, kernel-mode heap accessible only by the NuttX kernel,
|
||||
and (2) an unprotected user-mode heap for use by applications.
|
||||
If you are only interested in protecting the kernel from read access,
|
||||
then this option is not necessary. If you wish to secure the kernel data
|
||||
as well, then this option should be selected.
|
||||
|
||||
The kernel heap size that is used is provided a a platform-specific
|
||||
up_allocate_kheap() interface. This configuration setting is made
|
||||
|
||||
@@ -43,8 +43,10 @@
|
||||
*
|
||||
* CONFIG_BUILD_FLAT:
|
||||
* There is only kernel mode "blob" containing both kernel and
|
||||
* application code. There is only one heap that is used by both the
|
||||
* kernel and application logic.
|
||||
* application code. Depending upon the setting of CONFIG_MM_KERNEL_HEAP
|
||||
* there may be a single shared heap (used by both the kernel and
|
||||
* application logic) or there may be separate (although unprotected)
|
||||
* kernel and user heaps.
|
||||
*
|
||||
* In this configuration, this function is called early in nx_start()
|
||||
* to initialize the common heap.
|
||||
|
||||
Reference in New Issue
Block a user