Kconfig 13 KB

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