Kconfig 14 KB

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