Kconfig 12 KB

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