2012-04-06 23:49:35 +08:00
|
|
|
#
|
|
|
|
# For a description of the syntax of this configuration file,
|
2015-06-28 22:08:57 +08:00
|
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
2012-04-06 23:49:35 +08:00
|
|
|
#
|
2012-04-11 22:47:25 +08:00
|
|
|
|
2021-03-03 14:13:37 +08:00
|
|
|
choice
|
|
|
|
prompt "Build heap manager"
|
|
|
|
default MM_DEFAULT_MANAGER
|
|
|
|
|
|
|
|
config MM_DEFAULT_MANAGER
|
|
|
|
bool "Default heap manager"
|
|
|
|
---help---
|
|
|
|
NuttX original memory manager strategy.
|
|
|
|
|
|
|
|
config MM_CUSTOMIZE_MANAGER
|
|
|
|
bool "Customized heap manager"
|
|
|
|
---help---
|
2021-07-30 13:06:14 +08:00
|
|
|
Customized memory manager policy. The build will fail
|
2021-03-03 14:13:37 +08:00
|
|
|
if the MM heap module not defined by customer.
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
2013-03-09 09:27:42 +08:00
|
|
|
config MM_KERNEL_HEAP
|
|
|
|
bool "Support a protected, kernel heap"
|
|
|
|
default y
|
2020-04-29 22:52:26 +08:00
|
|
|
depends on !BUILD_FLAT
|
2013-03-09 09:27:42 +08:00
|
|
|
---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.
|
|
|
|
|
2013-03-10 05:12:20 +08:00
|
|
|
The kernel heap size that is used is provided a a platform-specific
|
|
|
|
up_allocate_kheap() interface. This configuration setting is made
|
|
|
|
available to that platform specific code. However, the
|
|
|
|
up_allocate_kheap() interface may chose to ignore this setting if it
|
|
|
|
has a more appropriate heap allocation strategy.
|
|
|
|
|
2013-03-09 09:27:42 +08:00
|
|
|
config MM_KERNEL_HEAPSIZE
|
2020-02-12 11:54:23 +08:00
|
|
|
int "Kernel heap size"
|
2013-03-09 09:27:42 +08:00
|
|
|
default 8192
|
|
|
|
depends on MM_KERNEL_HEAP
|
|
|
|
---help---
|
|
|
|
This is the size of the a protected, kernel-mode heap (in bytes).
|
|
|
|
The remaining of available memory is given to the unprotected
|
|
|
|
user-mode heap. This value may need to be aligned to units of the
|
|
|
|
size of the smallest memory protection region.
|
|
|
|
|
2012-04-11 22:47:25 +08:00
|
|
|
config MM_SMALL
|
|
|
|
bool "Small memory model"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
Each memory allocation has a small allocation overhead. The size
|
|
|
|
of that overhead is normally determined by the "width" of the
|
|
|
|
address support by the MCU. MCUs that support 16-bit addressability
|
|
|
|
have smaller overhead than devices that support 32-bit addressability.
|
|
|
|
However, there are many MCUs that support 32-bit addressability *but*
|
|
|
|
have internal SRAM of size less than or equal to 64Kb. In this case,
|
2013-04-26 05:52:00 +08:00
|
|
|
MM_SMALL can be defined so that those MCUs will also benefit
|
2012-04-11 22:47:25 +08:00
|
|
|
from the smaller, 16-bit-based allocation overhead.
|
2012-09-06 07:02:43 +08:00
|
|
|
|
2013-06-11 01:57:37 +08:00
|
|
|
WARNING: This selection will also change the alignment of allocated
|
|
|
|
memory. For example, on ARM memory will have 8-byte alignment by
|
|
|
|
default. If MM_SMALL is selected, then allocated memory will have
|
|
|
|
only 4-byte alignment. This may be important on some platforms where
|
|
|
|
64-bit data is in allocated structures and 8-byte alignment is required.
|
|
|
|
|
2012-09-06 07:02:43 +08:00
|
|
|
config MM_REGIONS
|
|
|
|
int "Number of memory regions"
|
|
|
|
default 1
|
|
|
|
---help---
|
|
|
|
If the architecture includes multiple, non-contiguous regions of
|
|
|
|
memory to allocate from, this specifies the number of memory regions
|
|
|
|
that the memory manager must handle and enables the API
|
2013-03-09 06:01:50 +08:00
|
|
|
mm_addregion(heap, start, end);
|
2012-09-06 07:02:43 +08:00
|
|
|
|
|
|
|
config ARCH_HAVE_HEAP2
|
|
|
|
bool
|
2014-01-24 02:06:57 +08:00
|
|
|
default n
|
|
|
|
|
|
|
|
if ARCH_HAVE_HEAP2
|
2012-09-06 07:02:43 +08:00
|
|
|
|
|
|
|
config HEAP2_BASE
|
2013-03-09 04:36:18 +08:00
|
|
|
hex "Start address of second user heap region"
|
2012-09-06 07:02:43 +08:00
|
|
|
default 0x00000000
|
|
|
|
---help---
|
|
|
|
The base address of the second heap region.
|
|
|
|
|
|
|
|
config HEAP2_SIZE
|
2013-03-09 04:36:18 +08:00
|
|
|
int "Size of the second user heap region"
|
2012-09-06 07:02:43 +08:00
|
|
|
default 0
|
|
|
|
---help---
|
|
|
|
The size of the second heap region.
|
|
|
|
|
2014-01-24 02:06:57 +08:00
|
|
|
endif # ARCH_HAVE_HEAP2
|
|
|
|
|
2012-09-12 04:33:58 +08:00
|
|
|
config GRAN
|
|
|
|
bool "Enable Granule Allocator"
|
|
|
|
default n
|
|
|
|
---help---
|
2014-08-24 06:35:52 +08:00
|
|
|
Enable granule allocator support. Allocations will be aligned to the
|
2012-09-12 04:33:58 +08:00
|
|
|
granule size; allocations will be in units of the granule size.
|
|
|
|
Larger granules will give better performance and less overhead but
|
|
|
|
more losses of memory due to alignment and quantization waste.
|
|
|
|
|
|
|
|
NOTE: The current implementation also restricts the maximum
|
2018-07-09 08:24:45 +08:00
|
|
|
allocation size to 32 granules. That restriction could be
|
2012-09-12 04:33:58 +08:00
|
|
|
eliminated with some additional coding effort.
|
|
|
|
|
2012-09-12 23:18:56 +08:00
|
|
|
config GRAN_INTR
|
|
|
|
bool "Interrupt level support"
|
|
|
|
default n
|
|
|
|
depends on GRAN
|
|
|
|
---help---
|
|
|
|
Normally mutual exclusive access to granule allocator data is assured
|
|
|
|
using a semaphore. If this option is set then, instead, mutual
|
|
|
|
exclusion logic will disable interrupts. While this options is more
|
|
|
|
invasive to system performance, it will also support use of the granule
|
|
|
|
allocator from interrupt level logic.
|
|
|
|
|
2012-09-12 04:33:58 +08:00
|
|
|
config DEBUG_GRAN
|
|
|
|
bool "Granule Allocator Debug"
|
|
|
|
default n
|
2016-06-12 04:14:08 +08:00
|
|
|
depends on GRAN && DEBUG_FEATURES
|
2012-09-12 04:33:58 +08:00
|
|
|
---help---
|
2014-08-24 06:35:52 +08:00
|
|
|
Just like DEBUG_MM, but only generates output from the gran
|
2012-09-12 04:33:58 +08:00
|
|
|
allocation logic.
|
2014-08-24 06:35:52 +08:00
|
|
|
|
|
|
|
config MM_PGALLOC
|
|
|
|
bool "Enable Page Allocator"
|
|
|
|
default n
|
2014-08-30 04:47:22 +08:00
|
|
|
depends on ARCH_USE_MMU
|
2014-08-24 06:35:52 +08:00
|
|
|
select GRAN
|
|
|
|
---help---
|
|
|
|
Enable support for a MMU physical page allocator based on the
|
|
|
|
granule allocator.
|
|
|
|
|
|
|
|
if MM_PGALLOC
|
|
|
|
|
|
|
|
config MM_PGSIZE
|
|
|
|
int "Page Size"
|
|
|
|
default 4096
|
2014-09-28 06:11:48 +08:00
|
|
|
---help---
|
2014-08-24 06:35:52 +08:00
|
|
|
The MMU page size. Must be one of {1024, 2048, 4096, 8192, or
|
|
|
|
16384}. This is easily extensible, but only those values are
|
|
|
|
currently support.
|
|
|
|
|
|
|
|
config DEBUG_PGALLOC
|
|
|
|
bool "Page Allocator Debug"
|
|
|
|
default n
|
2016-06-12 04:14:08 +08:00
|
|
|
depends on DEBUG_FEATURES
|
2014-08-24 06:35:52 +08:00
|
|
|
---help---
|
|
|
|
Just like DEBUG_MM, but only generates output from the page
|
|
|
|
allocation logic.
|
|
|
|
|
|
|
|
endif # MM_PGALLOC
|
2014-09-23 21:11:47 +08:00
|
|
|
|
|
|
|
config MM_SHM
|
|
|
|
bool "Shared memory support"
|
|
|
|
default n
|
|
|
|
depends on MM_PGALLOC && BUILD_KERNEL && EXPERIMENTAL
|
|
|
|
---help---
|
|
|
|
Build in support for the shared memory interfaces shmget(), shmat(),
|
|
|
|
shmctl(), and shmdt().
|
|
|
|
|
2020-11-12 18:40:06 +08:00
|
|
|
config MM_CIRCBUF
|
|
|
|
bool "Circular buffer support"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
Build in support for the circular buffer management.
|
|
|
|
|
2022-07-20 21:37:26 +08:00
|
|
|
config MM_MEMPOOL
|
|
|
|
bool "Enable memory buffer pool"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
Memory buffer pool support. Such pools are mostly used
|
|
|
|
for guaranteed, deadlock-free memory allocations.
|
|
|
|
|
2022-07-29 12:17:14 +08:00
|
|
|
config FS_PROCFS_EXCLUDE_MEMPOOL
|
|
|
|
bool "Exclude mempool"
|
|
|
|
default n
|
|
|
|
depends on FS_PROCFS
|
|
|
|
|
2021-10-09 15:22:28 +08:00
|
|
|
config MM_KASAN
|
|
|
|
bool "Kernel Address Sanitizer"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
KASan is a fast compiler-based tool for detecting memory
|
|
|
|
bugs in native code. After turn on this option, Please
|
|
|
|
add -fsanitize=kernel-address to CFLAGS/CXXFLAGS too.
|
|
|
|
|
2022-08-20 06:28:39 +08:00
|
|
|
config MM_KASAN_ALL
|
|
|
|
bool "Enable KASan for the entire image"
|
|
|
|
depends on MM_KASAN
|
|
|
|
default y
|
|
|
|
---help---
|
|
|
|
This option activates address sanitizer for the entire image.
|
|
|
|
If you don't enable this option, you have to explicitly specify
|
|
|
|
"-fsanitize=kernel-address" for the files/directories you want
|
|
|
|
to check. Enabling this option will get image size increased
|
|
|
|
and performance decreased significantly.
|
|
|
|
|
2022-08-19 16:09:59 +08:00
|
|
|
config MM_UBSAN
|
|
|
|
bool "Undefined Behavior Sanitizer"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
UBSan is a fast undefined behavior detector. UBSan modifies
|
|
|
|
the program at compile-time to catch various kinds of
|
|
|
|
undefined behavior during program execution
|
|
|
|
|
|
|
|
config MM_UBSAN_ALL
|
|
|
|
bool "Enable UBSan for the entire image"
|
|
|
|
depends on MM_UBSAN
|
|
|
|
default y
|
|
|
|
---help---
|
|
|
|
This option activates UBSan instrumentation for the
|
|
|
|
entire image. If you don't enable this option, you have to
|
|
|
|
explicitly specify "-fsanitize=undefined" for
|
|
|
|
the files/directories you want to check. Enabling this option
|
|
|
|
will get image size increased and performance decreased
|
|
|
|
significantly.
|
|
|
|
|
2022-09-02 12:42:45 +08:00
|
|
|
config MM_UBSAN_OPTION
|
|
|
|
string "UBSan options"
|
|
|
|
depends on MM_UBSAN
|
|
|
|
default "-fsanitize=undefined"
|
|
|
|
---help---
|
|
|
|
This option activates specified UBSan instrumentation. Please
|
|
|
|
refer to https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
|
|
|
|
for available options.
|
|
|
|
|
2022-08-19 16:09:59 +08:00
|
|
|
config MM_UBSAN_TRAP_ON_ERROR
|
|
|
|
bool "Enable UBsan trap on error to crash immediately"
|
|
|
|
depends on MM_UBSAN
|
|
|
|
default y
|
|
|
|
---help---
|
|
|
|
The undefined instruction trap should cause your program to crash,
|
|
|
|
save the code space significantly.
|
|
|
|
|
2022-07-20 21:37:26 +08:00
|
|
|
config MM_FILL_ALLOCATIONS
|
|
|
|
bool "Fill allocations with debug value"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
Fill all malloc() allocations with 0xAA. This helps
|
|
|
|
detecting uninitialized variable errors.
|
|
|
|
|
2022-05-20 16:37:14 +08:00
|
|
|
config MM_BACKTRACE
|
2022-07-04 15:41:06 +08:00
|
|
|
int "The depth of backtrace"
|
|
|
|
default -1
|
|
|
|
---help---
|
|
|
|
Config the depth of backtrace in memory block by specified this
|
|
|
|
config: disable backtrace by -1, only record pid info by zero and
|
|
|
|
enable record backtrace info by 8(fixed depth).
|
2022-05-20 16:37:14 +08:00
|
|
|
|
2022-03-22 10:37:49 +08:00
|
|
|
config MM_BACKTRACE_DEFAULT
|
|
|
|
bool "Enable the backtrace record by default"
|
|
|
|
default n
|
2022-07-04 15:41:06 +08:00
|
|
|
depends on MM_BACKTRACE > 0
|
2022-03-22 10:37:49 +08:00
|
|
|
|
2022-05-20 16:20:10 +08:00
|
|
|
config MM_DUMP_ON_FAILURE
|
|
|
|
bool "Dump heap info on allocation failure"
|
|
|
|
default n
|
|
|
|
depends on DEBUG_MM
|
|
|
|
|
2022-05-21 07:13:09 +08:00
|
|
|
config MM_PANIC_ON_FAILURE
|
|
|
|
bool "Panic on allocation failure"
|
|
|
|
default n
|
|
|
|
depends on DEBUG_MM
|
|
|
|
|
2017-05-09 21:34:59 +08:00
|
|
|
source "mm/iob/Kconfig"
|