Kconfig 13 KB

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