Kconfig 13 KB

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