Kconfig 12 KB

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