Kconfig 12 KB

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