Kconfig 14 KB

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