Kconfig 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  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_OVERFLOW_CHECK
  100. bool "Using stack overflow checking"
  101. default y
  102. help
  103. Enable thread stack overflow checking. The stack overflow is checking when
  104. each thread switch.
  105. config RT_USING_HOOK
  106. bool "Enable system hook"
  107. default y
  108. select RT_USING_IDLE_HOOK
  109. help
  110. Enable the hook function when system running, such as idle thread hook,
  111. thread context switch etc.
  112. if RT_USING_HOOK
  113. config RT_HOOK_USING_FUNC_PTR
  114. bool "Using function pointers as system hook"
  115. default y
  116. endif
  117. config RT_USING_HOOKLIST
  118. bool "Enable hook list"
  119. default n
  120. help
  121. Enable the hook list feature for rt-thread packages. With this, they can
  122. plug in to the system on run-time.
  123. config RT_USING_IDLE_HOOK
  124. bool "Enable IDLE Task hook"
  125. default y if RT_USING_HOOK
  126. if RT_USING_IDLE_HOOK
  127. config RT_IDLE_HOOK_LIST_SIZE
  128. int "The max size of idle hook list"
  129. default 4
  130. range 1 16
  131. help
  132. The system has a hook list. This is the hook list size.
  133. endif
  134. config IDLE_THREAD_STACK_SIZE
  135. int "The stack size of idle thread"
  136. default 1024 if ARCH_CPU_64BIT
  137. default 256
  138. config SYSTEM_THREAD_STACK_SIZE
  139. int "The stack size of system thread (for defunct etc.)"
  140. depends on RT_USING_SMP
  141. default IDLE_THREAD_STACK_SIZE
  142. config RT_USING_TIMER_SOFT
  143. bool "Enable software timer with a timer thread"
  144. default y
  145. help
  146. the timeout function context of soft-timer is under a high priority timer
  147. thread.
  148. if RT_USING_TIMER_SOFT
  149. config RT_TIMER_THREAD_PRIO
  150. int "The priority level value of timer thread"
  151. default 4
  152. config RT_TIMER_THREAD_STACK_SIZE
  153. int "The stack size of timer thread"
  154. default 2048 if ARCH_CPU_64BIT
  155. default 512
  156. endif
  157. menu "kservice optimization"
  158. config RT_USING_TINY_FFS
  159. bool "Enable kservice to use tiny finding first bit set method"
  160. default n
  161. endmenu
  162. menu "klibc optimization"
  163. config RT_KLIBC_USING_STDLIB
  164. bool "Enable klibc to use standard C library"
  165. default n
  166. if RT_KLIBC_USING_STDLIB
  167. config RT_KLIBC_USING_STDLIB_MEMORY
  168. bool "Use stdlib memory functions to replace (faster, but not safe)"
  169. default n
  170. help
  171. e.g. use memcpy to replace rt_memcpy
  172. endif
  173. config RT_KLIBC_USING_TINY_SIZE
  174. bool "Enable tiny size of klibc"
  175. default n
  176. config RT_KLIBC_USING_PRINTF_LONGLONG
  177. bool "Enable rt_printf-family functions to support long-long format"
  178. default y if ARCH_CPU_64BIT
  179. default n
  180. help
  181. Enable rt_printf()/rt_snprintf()/rt_sprintf()/rt_vsnprintf()/rt_vsprintf()
  182. functions to support long-long format
  183. endmenu
  184. menuconfig RT_USING_DEBUG
  185. bool "Enable debugging features"
  186. default y
  187. if RT_USING_DEBUG
  188. config RT_DEBUGING_ASSERT
  189. bool "Enable assertion debugging"
  190. default y
  191. config RT_DEBUGING_COLOR
  192. bool "Enable color debugging log"
  193. default y
  194. config RT_DEBUGING_CONTEXT
  195. bool "Enable debugging of environment and context check"
  196. default y
  197. config RT_DEBUGING_AUTO_INIT
  198. bool "Enable debugging of components automatic initialization"
  199. default n
  200. config RT_DEBUGING_PAGE_LEAK
  201. bool "Enable page leaking tracer"
  202. depends on ARCH_MM_MMU
  203. default n
  204. config RT_DEBUGING_SPINLOCK
  205. bool "Enable spinlock debugging"
  206. depends on RT_USING_SMP
  207. default n
  208. config RT_DEBUGING_CRITICAL
  209. bool "Enable critical level tracing"
  210. depends on RT_USING_SMP
  211. default y if RT_USING_SMART
  212. default n
  213. endif
  214. menu "Inter-Thread communication"
  215. config RT_USING_SEMAPHORE
  216. bool "Enable semaphore"
  217. default y
  218. config RT_USING_MUTEX
  219. bool "Enable mutex"
  220. default y
  221. config RT_USING_EVENT
  222. bool "Enable event flag"
  223. default y
  224. config RT_USING_MAILBOX
  225. bool "Enable mailbox"
  226. default y
  227. config RT_USING_MESSAGEQUEUE
  228. bool "Enable message queue"
  229. default y
  230. config RT_USING_MESSAGEQUEUE_PRIORITY
  231. bool "Enable message queue priority"
  232. depends on RT_USING_MESSAGEQUEUE
  233. default n
  234. config RT_USING_SIGNALS
  235. bool "Enable signals"
  236. select RT_USING_MEMPOOL
  237. default n
  238. help
  239. A signal is an asynchronous notification sent to a specific thread
  240. in order to notify it of an event that occurred.
  241. endmenu
  242. menu "Memory Management"
  243. config RT_PAGE_MAX_ORDER
  244. int "Max order of pages allocatable by page allocator"
  245. default 11
  246. depends on ARCH_MM_MMU
  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. config RT_USING_DEVICE
  347. bool "Using device object"
  348. depends on !RT_USING_NANO
  349. default y
  350. config RT_USING_DEVICE_OPS
  351. bool "Using ops for each device object"
  352. depends on RT_USING_DEVICE
  353. default n
  354. config RT_USING_INTERRUPT_INFO
  355. bool "Enable additional interrupt trace information"
  356. default n
  357. help
  358. Add name and counter information for interrupt trace.
  359. config RT_USING_THREADSAFE_PRINTF
  360. bool "Enable thread safe kernel print service"
  361. default y if RT_USING_SMP && RT_USING_SMART
  362. config RT_USING_SCHED_THREAD_CTX
  363. bool "Using the scheduler thread context"
  364. help
  365. Using the scheduler thread context embedded in the thread object.
  366. This options is only for backward compatible codes. Maybe use as a
  367. mandatory option in the future.
  368. default y if RT_USING_SMP
  369. config RT_USING_CONSOLE
  370. bool "Using console for rt_kprintf"
  371. default y
  372. if RT_USING_CONSOLE
  373. config RT_CONSOLEBUF_SIZE
  374. int "the buffer size for console log printf"
  375. default 128
  376. config RT_CONSOLE_DEVICE_NAME
  377. string "the device name for console"
  378. default "uart1"
  379. endif
  380. config RT_VER_NUM
  381. hex
  382. default 0x50200
  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. config RT_BACKTRACE_LEVEL_MAX_NR
  389. int "Max number of backtrace level"
  390. default 32
  391. endmenu