Kconfig 12 KB

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