Kconfig 12 KB

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