Kconfig 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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_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. select RT_USING_POSIX_FS
  32. select RT_USING_POSIX_TERMIOS
  33. select RT_USING_KTIME
  34. select RT_USING_STDC_ATOMIC
  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. help
  71. Number of CPUs in the system
  72. config RT_ALIGN_SIZE
  73. int "Alignment size for CPU architecture data access"
  74. default 8
  75. help
  76. Alignment size for CPU architecture data access
  77. choice
  78. prompt "The maximal level value of priority of thread"
  79. default RT_THREAD_PRIORITY_32
  80. config RT_THREAD_PRIORITY_8
  81. bool "8"
  82. config RT_THREAD_PRIORITY_32
  83. bool "32"
  84. config RT_THREAD_PRIORITY_256
  85. bool "256"
  86. endchoice
  87. config RT_THREAD_PRIORITY_MAX
  88. int
  89. default 8 if RT_THREAD_PRIORITY_8
  90. default 32 if RT_THREAD_PRIORITY_32
  91. default 256 if RT_THREAD_PRIORITY_256
  92. config RT_TICK_PER_SECOND
  93. int "Tick frequency, Hz"
  94. range 10 1000
  95. default 1000
  96. help
  97. System's tick frequency, Hz.
  98. config RT_USING_OVERFLOW_CHECK
  99. bool "Using stack overflow checking"
  100. default y
  101. help
  102. Enable thread stack overflow checking. The stack overflow is checking when
  103. each thread switch.
  104. config RT_USING_HOOK
  105. bool "Enable system hook"
  106. default y
  107. select RT_USING_IDLE_HOOK
  108. help
  109. Enable the hook function when system running, such as idle thread hook,
  110. thread context switch etc.
  111. if RT_USING_HOOK
  112. config RT_HOOK_USING_FUNC_PTR
  113. bool "Using function pointers as system hook"
  114. default y
  115. endif
  116. config RT_USING_HOOKLIST
  117. bool "Enable hook list"
  118. default n
  119. help
  120. Enable the hook list feature for rt-thread packages. With this, they can
  121. plug in to the system on run-time.
  122. config RT_USING_IDLE_HOOK
  123. bool "Enable IDLE Task hook"
  124. default y if RT_USING_HOOK
  125. if RT_USING_IDLE_HOOK
  126. config RT_IDLE_HOOK_LIST_SIZE
  127. int "The max size of idle hook list"
  128. default 4
  129. range 1 16
  130. help
  131. The system has a hook list. This is the hook list size.
  132. endif
  133. config IDLE_THREAD_STACK_SIZE
  134. int "The stack size of idle thread"
  135. default 1024 if ARCH_CPU_64BIT
  136. default 256
  137. config SYSTEM_THREAD_STACK_SIZE
  138. int "The stack size of system thread (for defunct etc.)"
  139. depends on RT_USING_SMP
  140. default IDLE_THREAD_STACK_SIZE
  141. config RT_USING_TIMER_SOFT
  142. bool "Enable software timer with a timer thread"
  143. default y
  144. help
  145. the timeout function context of soft-timer is under a high priority timer
  146. thread.
  147. if RT_USING_TIMER_SOFT
  148. config RT_TIMER_THREAD_PRIO
  149. int "The priority level value of timer thread"
  150. default 4
  151. config RT_TIMER_THREAD_STACK_SIZE
  152. int "The stack size of timer thread"
  153. default 2048 if ARCH_CPU_64BIT
  154. default 512
  155. endif
  156. menu "kservice optimization"
  157. config RT_KSERVICE_USING_STDLIB
  158. bool "Enable kservice to use standard C library"
  159. default y
  160. if RT_KSERVICE_USING_STDLIB
  161. config RT_KSERVICE_USING_STDLIB_MEMORY
  162. bool "Use stdlib memory functions to replace (faster, but not safe)"
  163. default n
  164. help
  165. e.g. use memcpy to replace rt_memcpy
  166. endif
  167. config RT_KSERVICE_USING_TINY_SIZE
  168. bool "Enable kservice to use tiny size"
  169. default n
  170. config RT_USING_TINY_FFS
  171. bool "Enable kservice to use tiny finding first bit set method"
  172. default n
  173. config RT_KPRINTF_USING_LONGLONG
  174. bool "Enable rt_printf-family functions to support long-long format"
  175. default y if ARCH_CPU_64BIT
  176. default n
  177. help
  178. Enable rt_printf()/rt_snprintf()/rt_sprintf()/rt_vsnprintf()/rt_vsprintf()
  179. functions to support long-long format
  180. endmenu
  181. menuconfig RT_USING_DEBUG
  182. bool "Enable debugging features"
  183. default y
  184. if RT_USING_DEBUG
  185. config RT_DEBUGING_COLOR
  186. bool "Enable color debugging log"
  187. default y
  188. config RT_DEBUGING_CONTEXT
  189. bool "Enable debugging of environment and context check"
  190. default y
  191. config RT_DEBUGING_AUTO_INIT
  192. bool "Enable debugging of components automatic initialization"
  193. default n
  194. config RT_DEBUGING_PAGE_LEAK
  195. bool "Enable page leaking tracer"
  196. depends on ARCH_MM_MMU
  197. default n
  198. config RT_DEBUGING_SPINLOCK
  199. bool "Enable spinlock debugging"
  200. depends on RT_USING_SMP
  201. default n
  202. endif
  203. menu "Inter-Thread communication"
  204. config RT_USING_SEMAPHORE
  205. bool "Enable semaphore"
  206. default y
  207. config RT_USING_MUTEX
  208. bool "Enable mutex"
  209. default y
  210. config RT_USING_EVENT
  211. bool "Enable event flag"
  212. default y
  213. config RT_USING_MAILBOX
  214. bool "Enable mailbox"
  215. default y
  216. config RT_USING_MESSAGEQUEUE
  217. bool "Enable message queue"
  218. default y
  219. config RT_USING_MESSAGEQUEUE_PRIORITY
  220. bool "Enable message queue priority"
  221. depends on RT_USING_MESSAGEQUEUE
  222. default n
  223. config RT_USING_SIGNALS
  224. bool "Enable signals"
  225. select RT_USING_MEMPOOL
  226. default n
  227. help
  228. A signal is an asynchronous notification sent to a specific thread
  229. in order to notify it of an event that occurred.
  230. endmenu
  231. menu "Memory Management"
  232. config RT_PAGE_MAX_ORDER
  233. int "Max order of pages allocatable by page allocator"
  234. default 11
  235. depends on ARCH_MM_MMU
  236. help
  237. For example, A value of 11 means the maximum chunk of contiguous memory
  238. allocatable by page system is 2^(11 + ARCH_PAGE_BITS - 1) Bytes.
  239. Large memory requirement can consume all system resource, and should
  240. consider reserved memory instead to enhance system endurance.
  241. Max order should at least satisfied usage by huge page.
  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. config RT_USING_DEVICE
  336. bool "Using device object"
  337. depends on !RT_USING_NANO
  338. default y
  339. config RT_USING_DEVICE_OPS
  340. bool "Using ops for each device object"
  341. depends on RT_USING_DEVICE
  342. default n
  343. config RT_USING_INTERRUPT_INFO
  344. bool "Enable additional interrupt trace information"
  345. default n
  346. help
  347. Add name and counter information for interrupt trace.
  348. config RT_USING_THREADSAFE_PRINTF
  349. bool "Enable thread safe kernel print service"
  350. default y if RT_USING_SMP && RT_USING_SMART
  351. config RT_USING_SCHED_THREAD_CTX
  352. bool "Using the scheduler thread context"
  353. help
  354. Using the scheduler thread context embedded in the thread object.
  355. This options is only for backward compatible codes. Maybe use as a
  356. mandatory option in the future.
  357. default y if RT_USING_SMP
  358. config RT_USING_CONSOLE
  359. bool "Using console for rt_kprintf"
  360. default y
  361. if RT_USING_CONSOLE
  362. config RT_CONSOLEBUF_SIZE
  363. int "the buffer size for console log printf"
  364. default 128
  365. config RT_CONSOLE_DEVICE_NAME
  366. string "the device name for console"
  367. default "uart1"
  368. endif
  369. config RT_VER_NUM
  370. hex
  371. default 0x50100
  372. help
  373. RT-Thread version number
  374. config RT_USING_STDC_ATOMIC
  375. bool "Use atomic implemented in stdatomic.h"
  376. default n
  377. config RT_BACKTRACE_LEVEL_MAX_NR
  378. int "Max number of backtrace level"
  379. default 32
  380. endmenu