Kconfig 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  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_SPINLOCK
  190. bool "Enable spinlock debugging"
  191. depends on RT_USING_SMP
  192. default n
  193. config RT_DEBUGING_CRITICAL
  194. bool "Enable critical level tracing"
  195. depends on RT_USING_SMP
  196. default y if RT_USING_SMART
  197. default n
  198. endif
  199. config RT_USING_CI_ACTION
  200. bool "Enable CI Action build mode"
  201. select RT_USING_UTEST
  202. select RT_UTEST_USING_AUTO_RUN
  203. select RT_UTEST_USING_ALL_CASES
  204. default n
  205. help
  206. Identify that the environment is CI Action.
  207. menu "Inter-Thread communication"
  208. config RT_USING_SEMAPHORE
  209. bool "Enable semaphore"
  210. default y
  211. config RT_USING_MUTEX
  212. bool "Enable mutex"
  213. default y
  214. config RT_USING_EVENT
  215. bool "Enable event flag"
  216. default y
  217. config RT_USING_MAILBOX
  218. bool "Enable mailbox"
  219. default y
  220. config RT_USING_MESSAGEQUEUE
  221. bool "Enable message queue"
  222. default y
  223. config RT_USING_MESSAGEQUEUE_PRIORITY
  224. bool "Enable message queue priority"
  225. depends on RT_USING_MESSAGEQUEUE
  226. default n
  227. config RT_USING_SIGNALS
  228. bool "Enable signals"
  229. select RT_USING_MEMPOOL
  230. default n
  231. help
  232. A signal is an asynchronous notification sent to a specific thread
  233. in order to notify it of an event that occurred.
  234. endmenu
  235. menu "Memory Management"
  236. config RT_USING_MEMPOOL
  237. bool "Using memory pool"
  238. default y
  239. help
  240. Using static memory fixed partition
  241. config RT_USING_SMALL_MEM
  242. bool "Using Small Memory Algorithm"
  243. default n
  244. help
  245. Using Small Memory Algorithm
  246. config RT_USING_SLAB
  247. bool "Using SLAB Memory Algorithm"
  248. default n
  249. help
  250. The slab allocator of RT-Thread is a memory allocation algorithm
  251. optimizedfor embedded systems based on the slab allocator
  252. implemented by Matthew Dillon, founder of dragonfly BSD.
  253. The original slab algorithm is an efficient kernel memory
  254. allocation algorithm introduced by Jeff bonwick for
  255. Solaris Operating System.
  256. menuconfig RT_USING_MEMHEAP
  257. bool "Using memheap Memory Algorithm"
  258. default n
  259. if RT_USING_MEMHEAP
  260. choice
  261. prompt "Memheap memory allocation mode"
  262. default RT_MEMHEAP_FAST_MODE
  263. config RT_MEMHEAP_FAST_MODE
  264. bool "fast mode"
  265. help
  266. Speed priority mode.
  267. As long as the memory block size meets the requirements, the search ends immediately.
  268. config RT_MEMHEAP_BEST_MODE
  269. bool "best mode"
  270. help
  271. Best size first.
  272. The search does not end until the memory block of the most appropriate size is found
  273. endchoice
  274. endif
  275. choice
  276. prompt "System Heap Memory Management"
  277. default RT_USING_SMALL_MEM_AS_HEAP
  278. config RT_USING_SMALL_MEM_AS_HEAP
  279. bool "Small Memory Algorithm"
  280. select RT_USING_SMALL_MEM
  281. config RT_USING_MEMHEAP_AS_HEAP
  282. bool "Use memheap objects as heap"
  283. select RT_USING_MEMHEAP
  284. if RT_USING_MEMHEAP_AS_HEAP
  285. config RT_USING_MEMHEAP_AUTO_BINDING
  286. bool "Use all of memheap objects as heap"
  287. default y
  288. endif
  289. config RT_USING_SLAB_AS_HEAP
  290. bool "SLAB Algorithm for large memory"
  291. select RT_USING_SLAB
  292. config RT_USING_USERHEAP
  293. bool "Use user heap"
  294. help
  295. If this option is selected, please implement these functions:
  296. rt_malloc(), rt_malloc_sethook()
  297. rt_free(), rt_free_sethook()
  298. rt_calloc(), rt_realloc()
  299. rt_memory_info()
  300. rt_system_heap_init()
  301. config RT_USING_NOHEAP
  302. bool "Disable Heap"
  303. endchoice
  304. config RT_USING_MEMTRACE
  305. bool "Enable memory trace"
  306. default n
  307. help
  308. When enable RT_USING_MEMTRACE with shell, developer can call cmd:
  309. 1. memtrace
  310. to dump memory block information.
  311. 2. memcheck
  312. to check memory block to avoid memory overwritten.
  313. And developer also can call memcheck() in each of scheduling
  314. to check memory block to find which thread has wrongly modified
  315. memory.
  316. config RT_USING_HEAP_ISR
  317. bool "Using heap in ISR"
  318. default n
  319. help
  320. When this option is enabled, the critical zone will be protected with disable interrupt.
  321. config RT_USING_HEAP
  322. bool
  323. default n if RT_USING_NOHEAP
  324. default y if RT_USING_SMALL_MEM
  325. default y if RT_USING_SLAB
  326. default y if RT_USING_MEMHEAP_AS_HEAP
  327. default y if RT_USING_USERHEAP
  328. endmenu
  329. config RT_USING_DEVICE
  330. bool "Using device object"
  331. depends on !RT_USING_NANO
  332. default y
  333. config RT_USING_DEVICE_OPS
  334. bool "Using ops for each device object"
  335. depends on RT_USING_DEVICE
  336. default n
  337. config RT_USING_INTERRUPT_INFO
  338. bool "Enable additional interrupt trace information"
  339. default n
  340. help
  341. Add name and counter information for interrupt trace.
  342. config RT_USING_THREADSAFE_PRINTF
  343. bool "Enable thread safe kernel print service"
  344. default y if RT_USING_SMP && RT_USING_SMART
  345. config RT_USING_CONSOLE
  346. bool "Using console for rt_kprintf"
  347. default y
  348. if RT_USING_CONSOLE
  349. config RT_CONSOLEBUF_SIZE
  350. int "the buffer size for console log printf"
  351. default 256 if RT_USING_UTEST
  352. default 128
  353. config RT_CONSOLE_DEVICE_NAME
  354. string "the device name for console"
  355. default "uart1"
  356. endif
  357. config RT_VER_NUM
  358. hex
  359. default 0x50201
  360. help
  361. RT-Thread version number
  362. config RT_USING_STDC_ATOMIC
  363. bool "Use atomic implemented in stdatomic.h"
  364. default n
  365. config RT_BACKTRACE_LEVEL_MAX_NR
  366. int "Max number of backtrace level"
  367. default 32
  368. endmenu