Kconfig 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  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. config RT_DEBUG_THREAD
  177. bool "Enable debugging of Thread State Changes"
  178. default n
  179. config RT_DEBUG_SCHEDULER
  180. bool "Enable debugging of Scheduler"
  181. default n
  182. config RT_DEBUG_IPC
  183. bool "Enable debugging of IPC"
  184. default n
  185. config RT_DEBUG_TIMER
  186. bool "Enable debugging of Timer"
  187. default n
  188. config RT_DEBUG_IRQ
  189. bool "Enable debugging of IRQ(Interrupt Request)"
  190. default n
  191. config RT_DEBUG_MEM
  192. bool "Enable debugging of Small Memory Algorithm"
  193. default n
  194. config RT_DEBUG_SLAB
  195. bool "Enable debugging of SLAB Memory Algorithm"
  196. default n
  197. config RT_DEBUG_MEMHEAP
  198. bool "Enable debugging of Memory Heap Algorithm"
  199. default n
  200. if ARCH_MM_MMU
  201. config RT_DEBUG_PAGE_LEAK
  202. bool "Enable page leaking tracer"
  203. default n
  204. endif
  205. config RT_DEBUG_MODULE
  206. bool "Enable debugging of Application Module"
  207. default n
  208. endif
  209. menu "Inter-Thread communication"
  210. config RT_USING_SEMAPHORE
  211. bool "Enable semaphore"
  212. default y
  213. config RT_USING_MUTEX
  214. bool "Enable mutex"
  215. default y
  216. config RT_USING_EVENT
  217. bool "Enable event flag"
  218. default y
  219. config RT_USING_MAILBOX
  220. bool "Enable mailbox"
  221. default y
  222. config RT_USING_MESSAGEQUEUE
  223. bool "Enable message queue"
  224. default y
  225. if RT_USING_MESSAGEQUEUE
  226. config RT_USING_MESSAGEQUEUE_PRIORITY
  227. bool "Enable message queue priority"
  228. default n
  229. endif
  230. config RT_USING_SIGNALS
  231. bool "Enable signals"
  232. select RT_USING_MEMPOOL
  233. default n
  234. help
  235. A signal is an asynchronous notification sent to a specific thread
  236. in order to notify it of an event that occurred.
  237. endmenu
  238. menu "Memory Management"
  239. if ARCH_MM_MMU
  240. config RT_PAGE_MAX_ORDER
  241. int "Max order of pages allocatable by page allocator"
  242. default 11
  243. help
  244. For example, A value of 11 means the maximum chunk of contiguous memory
  245. allocatable by page system is 2^(11 + ARCH_PAGE_BITS - 1) Bytes.
  246. Large memory requirement can consume all system resource, and should
  247. consider reserved memory instead to enhance system endurance.
  248. Max order should at least satisfied usage by huge page.
  249. endif
  250. config RT_USING_MEMPOOL
  251. bool "Using memory pool"
  252. default y
  253. help
  254. Using static memory fixed partition
  255. config RT_USING_SMALL_MEM
  256. bool "Using Small Memory Algorithm"
  257. default n
  258. help
  259. Using Small Memory Algorithm
  260. config RT_USING_SLAB
  261. bool "Using SLAB Memory Algorithm"
  262. default n
  263. help
  264. The slab allocator of RT-Thread is a memory allocation algorithm
  265. optimizedfor embedded systems based on the slab allocator
  266. implemented by Matthew Dillon, founder of dragonfly BSD.
  267. The original slab algorithm is an efficient kernel memory
  268. allocation algorithm introduced by Jeff bonwick for
  269. Solaris Operating System.
  270. menuconfig RT_USING_MEMHEAP
  271. bool "Using memheap Memory Algorithm"
  272. default n
  273. if RT_USING_MEMHEAP
  274. choice
  275. prompt "Memheap memory allocation mode"
  276. default RT_MEMHEAP_FAST_MODE
  277. config RT_MEMHEAP_FAST_MODE
  278. bool "fast mode"
  279. help
  280. Speed priority mode.
  281. As long as the memory block size meets the requirements, the search ends immediately.
  282. config RT_MEMHEAP_BEST_MODE
  283. bool "best mode"
  284. help
  285. Best size first.
  286. The search does not end until the memory block of the most appropriate size is found
  287. endchoice
  288. endif
  289. choice
  290. prompt "System Heap Memory Management"
  291. default RT_USING_SMALL_MEM_AS_HEAP
  292. config RT_USING_SMALL_MEM_AS_HEAP
  293. bool "Small Memory Algorithm"
  294. select RT_USING_SMALL_MEM
  295. config RT_USING_MEMHEAP_AS_HEAP
  296. bool "Use memheap objects as heap"
  297. select RT_USING_MEMHEAP
  298. if RT_USING_MEMHEAP_AS_HEAP
  299. config RT_USING_MEMHEAP_AUTO_BINDING
  300. bool "Use all of memheap objects as heap"
  301. default y
  302. endif
  303. config RT_USING_SLAB_AS_HEAP
  304. bool "SLAB Algorithm for large memory"
  305. select RT_USING_SLAB
  306. config RT_USING_USERHEAP
  307. bool "Use user heap"
  308. help
  309. If this option is selected, please implement these functions:
  310. rt_malloc(), rt_malloc_sethook()
  311. rt_free(), rt_free_sethook()
  312. rt_calloc(), rt_realloc()
  313. rt_memory_info()
  314. rt_system_heap_init()
  315. config RT_USING_NOHEAP
  316. bool "Disable Heap"
  317. endchoice
  318. config RT_USING_MEMTRACE
  319. bool "Enable memory trace"
  320. default n
  321. help
  322. When enable RT_USING_MEMTRACE with shell, developer can call cmd:
  323. 1. memtrace
  324. to dump memory block information.
  325. 2. memcheck
  326. to check memory block to avoid memory overwritten.
  327. And developer also can call memcheck() in each of scheduling
  328. to check memory block to find which thread has wrongly modified
  329. memory.
  330. config RT_USING_HEAP_ISR
  331. bool "Using heap in ISR"
  332. default n
  333. help
  334. When this option is enabled, the critical zone will be protected with disable interrupt.
  335. config RT_USING_HEAP
  336. bool
  337. default n if RT_USING_NOHEAP
  338. default y if RT_USING_SMALL_MEM
  339. default y if RT_USING_SLAB
  340. default y if RT_USING_MEMHEAP_AS_HEAP
  341. default y if RT_USING_USERHEAP
  342. endmenu
  343. menu "Kernel Device Object"
  344. config RT_USING_DEVICE
  345. bool "Using device object"
  346. default y
  347. config RT_USING_DEVICE_OPS
  348. bool "Using ops for each device object"
  349. default n
  350. config RT_USING_DM
  351. bool "Enable device driver model with device tree"
  352. default n
  353. help
  354. Enable device driver model with device tree (FDT). It will use more memory
  355. to parse and support device tree feature.
  356. config RT_USING_DM_FDT
  357. bool "Enablie builtin libfdt"
  358. depends on RT_USING_DM
  359. default y
  360. help
  361. libfdt - Flat Device Tree manipulation. If your code already contains the
  362. libfdt, you can cancel this built-in libfdt to avoid link issue.
  363. config RT_USING_INTERRUPT_INFO
  364. bool "Enable additional interrupt trace information"
  365. default n
  366. help
  367. Add name and counter information for interrupt trace.
  368. config RT_USING_CONSOLE
  369. bool "Using console for rt_kprintf"
  370. default y
  371. if RT_USING_CONSOLE
  372. config RT_CONSOLEBUF_SIZE
  373. int "the buffer size for console log printf"
  374. default 128
  375. config RT_CONSOLE_DEVICE_NAME
  376. string "the device name for console"
  377. default "uart"
  378. endif
  379. endmenu
  380. config RT_VER_NUM
  381. hex
  382. default 0x50001
  383. help
  384. RT-Thread version number
  385. config RT_USING_STDC_ATOMIC
  386. bool "Use atomic implemented in stdatomic.h"
  387. default n
  388. endmenu