Kconfig 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. menu "RT-Thread Kernel"
  2. rsource "klibc/Kconfig"
  3. config RT_NAME_MAX
  4. int "The maximal size of kernel object name"
  5. range 2 64
  6. default 8
  7. help
  8. Each kernel object, such as thread, timer, semaphore etc, has a name,
  9. the RT_NAME_MAX is the maximal size of this object name.
  10. config RT_USING_ARCH_DATA_TYPE
  11. bool "Use the data types defined in ARCH_CPU"
  12. default n
  13. help
  14. For the data type like, `rt_uint8/int8_t, rt_uint16/int16_t, rt_uint32/int32_t`,
  15. BSP can define these basic data types in ARCH_CPU level.
  16. Please re-define these data types in rtconfig_project.h file.
  17. config RT_USING_NANO
  18. bool "Enable RT-Thread Nano"
  19. default n
  20. help
  21. RT-Thread Nano is a very small size and refined hard real-time kernel,
  22. which is suited for the extremely resource-constrained MCU system.
  23. config RT_USING_SMART
  24. bool "Enable RT-Thread Smart (microkernel on kernel/userland)"
  25. default n
  26. select RT_USING_LWP
  27. select RT_USING_DFS
  28. select RT_USING_POSIX_CLOCKTIME
  29. select RT_USING_DEVICE
  30. select RT_USING_NULL
  31. select RT_USING_ZERO
  32. select RT_USING_RANDOM
  33. select RT_USING_RTC
  34. select RT_USING_POSIX_TIMER
  35. select RT_USING_POSIX_CLOCK
  36. select RT_USING_POSIX_FS
  37. select RT_USING_POSIX_TERMIOS
  38. select RT_USING_KTIME
  39. select RT_USING_STDC_ATOMIC
  40. select RT_USING_SYSTEM_WORKQUEUE
  41. select RT_USING_CPU_USAGE_TRACER
  42. select RT_USING_SCHED_THREAD_CTX
  43. depends on ARCH_ARM_CORTEX_M || ARCH_ARM_ARM9 || ARCH_ARM_CORTEX_A || ARCH_ARMV8 || ARCH_RISCV64
  44. depends on !RT_USING_NANO
  45. help
  46. RT-Thread Smart is a microkernel based operating system on RT-Thread.
  47. config RT_USING_AMP
  48. bool "Enable AMP (Asymmetric Multi-Processing)"
  49. default n
  50. if RT_USING_AMP
  51. choice
  52. prompt "Select the AMP role"
  53. default RT_AMP_SLAVE
  54. config RT_AMP_MASTER
  55. bool "amp role MASTER"
  56. config RT_AMP_SLAVE
  57. bool "amp role SLAVE"
  58. endchoice
  59. endif
  60. config RT_USING_SMP
  61. bool "Enable SMP (Symmetric multiprocessing)"
  62. default n
  63. help
  64. This option should be selected by machines which have an SMP-
  65. capable CPU.
  66. The only effect of this option is to make the SMP-related
  67. options available to the user for configuration.
  68. config RT_CPUS_NR
  69. int "Number of CPUs"
  70. default 1
  71. range 1 1 if !RT_USING_SMP && !RT_USING_AMP
  72. help
  73. Number of CPUs in the system
  74. config RT_ALIGN_SIZE
  75. int "Alignment size for CPU architecture data access"
  76. default 8
  77. help
  78. Alignment size for CPU architecture data access
  79. choice
  80. prompt "The maximal level value of priority of thread"
  81. default RT_THREAD_PRIORITY_32
  82. config RT_THREAD_PRIORITY_8
  83. bool "8"
  84. config RT_THREAD_PRIORITY_32
  85. bool "32"
  86. config RT_THREAD_PRIORITY_256
  87. bool "256"
  88. endchoice
  89. config RT_THREAD_PRIORITY_MAX
  90. int
  91. default 8 if RT_THREAD_PRIORITY_8
  92. default 32 if RT_THREAD_PRIORITY_32
  93. default 256 if RT_THREAD_PRIORITY_256
  94. config RT_TICK_PER_SECOND
  95. int "Tick frequency, Hz"
  96. range 10 1000
  97. default 1000
  98. help
  99. System's tick frequency, Hz.
  100. config RT_USING_OVERFLOW_CHECK
  101. bool "Using stack overflow checking"
  102. default y if RT_USING_DEBUG
  103. help
  104. Enable thread stack overflow checking. The stack overflow is checking when
  105. each thread switch.
  106. config RT_USING_HOOK
  107. bool "Enable system hook"
  108. default y
  109. select RT_USING_IDLE_HOOK
  110. help
  111. Enable the hook function when system running, such as idle thread hook,
  112. thread context switch etc.
  113. if RT_USING_HOOK
  114. config RT_HOOK_USING_FUNC_PTR
  115. bool "Using function pointers as system hook"
  116. default y
  117. endif
  118. config RT_USING_HOOKLIST
  119. bool "Enable hook list"
  120. default n
  121. help
  122. Enable the hook list feature for rt-thread packages. With this, they can
  123. plug in to the system on run-time.
  124. config RT_USING_IDLE_HOOK
  125. bool "Enable IDLE Task hook"
  126. default y if RT_USING_HOOK
  127. if RT_USING_IDLE_HOOK
  128. config RT_IDLE_HOOK_LIST_SIZE
  129. int "The max size of idle hook list"
  130. default 4
  131. range 1 16
  132. help
  133. The system has a hook list. This is the hook list size.
  134. endif
  135. config IDLE_THREAD_STACK_SIZE
  136. int "The stack size of idle thread"
  137. default 1024 if ARCH_CPU_64BIT
  138. default 256
  139. config SYSTEM_THREAD_STACK_SIZE
  140. int "The stack size of system thread (for defunct etc.)"
  141. depends on RT_USING_SMP
  142. default IDLE_THREAD_STACK_SIZE
  143. config RT_USING_TIMER_SOFT
  144. bool "Enable software timer with a timer thread"
  145. default y
  146. help
  147. the timeout function context of soft-timer is under a high priority timer
  148. thread.
  149. if RT_USING_TIMER_SOFT
  150. config RT_TIMER_THREAD_PRIO
  151. int "The priority level value of timer thread"
  152. default 4
  153. config RT_TIMER_THREAD_STACK_SIZE
  154. int "The stack size of timer thread"
  155. default 2048 if ARCH_CPU_64BIT
  156. default 512
  157. config RT_USING_TIMER_ALL_SOFT
  158. bool "Set all timer as soft timer"
  159. default n
  160. endif
  161. config RT_USING_CPU_USAGE_TRACER
  162. select RT_USING_HOOK
  163. bool "Enable cpu usage tracing"
  164. help
  165. Enable cpu usage tracer for application like top.
  166. default y if RT_USING_SMART
  167. default n
  168. menu "kservice options"
  169. config RT_USING_TINY_FFS
  170. bool "Enable kservice to use tiny finding first bit set method"
  171. default n
  172. endmenu
  173. menuconfig RT_USING_DEBUG
  174. bool "Enable debugging features"
  175. default y
  176. if RT_USING_DEBUG
  177. config RT_DEBUGING_ASSERT
  178. bool "Enable assertion debugging"
  179. default y
  180. config RT_DEBUGING_COLOR
  181. bool "Enable color debugging log"
  182. default y
  183. config RT_DEBUGING_CONTEXT
  184. bool "Enable debugging of environment and context check"
  185. default y
  186. config RT_DEBUGING_AUTO_INIT
  187. bool "Enable debugging of components automatic initialization"
  188. default n
  189. config RT_DEBUGING_PAGE_LEAK
  190. bool "Enable page leaking tracer"
  191. depends on ARCH_MM_MMU
  192. default n
  193. config RT_DEBUGING_SPINLOCK
  194. bool "Enable spinlock debugging"
  195. depends on RT_USING_SMP
  196. default n
  197. config RT_DEBUGING_CRITICAL
  198. bool "Enable critical level tracing"
  199. depends on RT_USING_SMP
  200. default y if RT_USING_SMART
  201. default n
  202. endif
  203. config RT_USING_CI_ACTION
  204. bool "Enable CI Action build mode"
  205. select RT_USING_UTEST
  206. select RT_UTEST_USING_AUTO_RUN
  207. select RT_UTEST_USING_ALL_CASES
  208. default n
  209. help
  210. Identify that the environment is CI Action.
  211. menu "Inter-Thread communication"
  212. config RT_USING_SEMAPHORE
  213. bool "Enable semaphore"
  214. default y
  215. config RT_USING_MUTEX
  216. bool "Enable mutex"
  217. default y
  218. config RT_USING_EVENT
  219. bool "Enable event flag"
  220. default y
  221. config RT_USING_MAILBOX
  222. bool "Enable mailbox"
  223. default y
  224. config RT_USING_MESSAGEQUEUE
  225. bool "Enable message queue"
  226. default y
  227. config RT_USING_MESSAGEQUEUE_PRIORITY
  228. bool "Enable message queue priority"
  229. depends on RT_USING_MESSAGEQUEUE
  230. default n
  231. config RT_USING_SIGNALS
  232. bool "Enable signals"
  233. select RT_USING_MEMPOOL
  234. default n
  235. help
  236. A signal is an asynchronous notification sent to a specific thread
  237. in order to notify it of an event that occurred.
  238. endmenu
  239. menu "Memory Management"
  240. config RT_PAGE_MAX_ORDER
  241. int "Max order of pages allocatable by page allocator"
  242. default 11
  243. depends on ARCH_MM_MMU
  244. help
  245. For example, A value of 11 means the maximum chunk of contiguous memory
  246. allocatable by page system is 2^(11 + ARCH_PAGE_BITS - 1) Bytes.
  247. Large memory requirement can consume all system resource, and should
  248. consider reserved memory instead to enhance system endurance.
  249. Max order should at least satisfied usage by huge page.
  250. config RT_USING_MEMPOOL
  251. bool "Using memory pool"
  252. default y
  253. help
  254. Using static memory fixed partition
  255. config RT_USING_SMALL_MEM
  256. bool "Using Small Memory Algorithm"
  257. default n
  258. help
  259. Using Small Memory Algorithm
  260. config RT_USING_SLAB
  261. bool "Using SLAB Memory Algorithm"
  262. default n
  263. help
  264. The slab allocator of RT-Thread is a memory allocation algorithm
  265. optimizedfor embedded systems based on the slab allocator
  266. implemented by Matthew Dillon, founder of dragonfly BSD.
  267. The original slab algorithm is an efficient kernel memory
  268. allocation algorithm introduced by Jeff bonwick for
  269. Solaris Operating System.
  270. menuconfig RT_USING_MEMHEAP
  271. bool "Using memheap Memory Algorithm"
  272. default n
  273. if RT_USING_MEMHEAP
  274. choice
  275. prompt "Memheap memory allocation mode"
  276. default RT_MEMHEAP_FAST_MODE
  277. config RT_MEMHEAP_FAST_MODE
  278. bool "fast mode"
  279. help
  280. Speed priority mode.
  281. As long as the memory block size meets the requirements, the search ends immediately.
  282. config RT_MEMHEAP_BEST_MODE
  283. bool "best mode"
  284. help
  285. Best size first.
  286. The search does not end until the memory block of the most appropriate size is found
  287. endchoice
  288. endif
  289. choice
  290. prompt "System Heap Memory Management"
  291. default RT_USING_SMALL_MEM_AS_HEAP
  292. config RT_USING_SMALL_MEM_AS_HEAP
  293. bool "Small Memory Algorithm"
  294. select RT_USING_SMALL_MEM
  295. config RT_USING_MEMHEAP_AS_HEAP
  296. bool "Use memheap objects as heap"
  297. select RT_USING_MEMHEAP
  298. if RT_USING_MEMHEAP_AS_HEAP
  299. config RT_USING_MEMHEAP_AUTO_BINDING
  300. bool "Use all of memheap objects as heap"
  301. default y
  302. endif
  303. config RT_USING_SLAB_AS_HEAP
  304. bool "SLAB Algorithm for large memory"
  305. select RT_USING_SLAB
  306. config RT_USING_USERHEAP
  307. bool "Use user heap"
  308. help
  309. If this option is selected, please implement these functions:
  310. rt_malloc(), rt_malloc_sethook()
  311. rt_free(), rt_free_sethook()
  312. rt_calloc(), rt_realloc()
  313. rt_memory_info()
  314. rt_system_heap_init()
  315. config RT_USING_NOHEAP
  316. bool "Disable Heap"
  317. endchoice
  318. config RT_USING_MEMTRACE
  319. bool "Enable memory trace"
  320. default n
  321. help
  322. When enable RT_USING_MEMTRACE with shell, developer can call cmd:
  323. 1. memtrace
  324. to dump memory block information.
  325. 2. memcheck
  326. to check memory block to avoid memory overwritten.
  327. And developer also can call memcheck() in each of scheduling
  328. to check memory block to find which thread has wrongly modified
  329. memory.
  330. config RT_USING_HEAP_ISR
  331. bool "Using heap in ISR"
  332. default n
  333. help
  334. When this option is enabled, the critical zone will be protected with disable interrupt.
  335. config RT_USING_HEAP
  336. bool
  337. default n if RT_USING_NOHEAP
  338. default y if RT_USING_SMALL_MEM
  339. default y if RT_USING_SLAB
  340. default y if RT_USING_MEMHEAP_AS_HEAP
  341. default y if RT_USING_USERHEAP
  342. endmenu
  343. config RT_USING_DEVICE
  344. bool "Using device object"
  345. depends on !RT_USING_NANO
  346. default y
  347. config RT_USING_DEVICE_OPS
  348. bool "Using ops for each device object"
  349. depends on RT_USING_DEVICE
  350. default n
  351. config RT_USING_INTERRUPT_INFO
  352. bool "Enable additional interrupt trace information"
  353. default n
  354. help
  355. Add name and counter information for interrupt trace.
  356. config RT_USING_THREADSAFE_PRINTF
  357. bool "Enable thread safe kernel print service"
  358. default y if RT_USING_SMP && RT_USING_SMART
  359. config RT_USING_CONSOLE
  360. bool "Using console for rt_kprintf"
  361. default y
  362. if RT_USING_CONSOLE
  363. config RT_CONSOLEBUF_SIZE
  364. int "the buffer size for console log printf"
  365. default 256 if RT_USING_UTEST
  366. default 128
  367. config RT_CONSOLE_DEVICE_NAME
  368. string "the device name for console"
  369. default "uart1"
  370. endif
  371. config RT_VER_NUM
  372. hex
  373. default 0x50200
  374. help
  375. RT-Thread version number
  376. config RT_USING_STDC_ATOMIC
  377. bool "Use atomic implemented in stdatomic.h"
  378. default n
  379. config RT_BACKTRACE_LEVEL_MAX_NR
  380. int "Max number of backtrace level"
  381. default 32
  382. endmenu