Kconfig 13 KB

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