Kconfig 13.2 KB
Newer Older
S
Shell 已提交
1
#include "rtconfig.h"
B
Bernard Xiong 已提交
2
menu "RT-Thread Kernel"
B
bernard 已提交
3 4 5

config RT_NAME_MAX
    int "The maximal size of kernel object name"
6
    range 1 64
B
bernard 已提交
7
    default 8
8 9
    help
        Each kernel object, such as thread, timer, semaphore etc, has a name,
10
        the RT_NAME_MAX is the maximal size of this object name.
B
bernard 已提交
11

12 13 14 15 16 17 18
config RT_USING_ARCH_DATA_TYPE
    bool "Use the data types defined in ARCH_CPU"
    default n
    help
        For the data type like, `rt_uint8/int8_t, rt_uint16/int16_t, rt_uint32/int32_t`,
        BSP can define these basic data types in ARCH_CPU level.

19
        Please re-define these data types in rtconfig_project.h file.
20

G
guo 已提交
21 22 23 24
config RT_USING_SMART
    bool "Enable RT-Thread Smart (microkernel on kernel/userland)"
    default n
    select RT_USING_LWP
25 26 27 28 29 30 31 32
    select RT_USING_DFS
    select RT_USING_LIBC
    select RT_USING_POSIX_CLOCKTIME
    select RT_USING_TTY
    select RT_USING_NULL
    select RT_USING_ZERO
    select RT_USING_RANDOM
    select RT_USING_RTC
Z
zhkag 已提交
33 34
    select RT_USING_POSIX_TIMER
    select RT_USING_POSIX_CLOCK
S
Shell 已提交
35
    depends on ARCH_ARM_CORTEX_M || ARCH_ARM_ARM9 || ARCH_ARM_CORTEX_A || ARCH_ARMV8 || ARCH_RISCV64
G
guo 已提交
36 37 38
    help
        RT-Thread Smart is a microkernel based operating system on RT-Thread.

S
shaojinchun 已提交
39 40 41
config RT_USING_SMP
    bool "Enable SMP(Symmetric multiprocessing)"
    default n
42
    help
S
shaojinchun 已提交
43 44 45 46 47 48 49
        This option should be selected by machines which have an SMP-
        capable CPU.
        The only effect of this option is to make the SMP-related
        options available to the user for configuration.

config RT_CPUS_NR
    int "Number of CPUs"
50 51
    default 2
    depends on RT_USING_SMP
S
shaojinchun 已提交
52
    help
53
        Number of CPUs in the system
S
shaojinchun 已提交
54

B
bernard 已提交
55 56
config RT_ALIGN_SIZE
    int "Alignment size for CPU architecture data access"
57
    default 8
B
bernard 已提交
58 59 60
    help
        Alignment size for CPU architecture data access

61
    choice
62 63 64 65 66 67 68 69 70 71 72 73 74
        prompt "The maximal level value of priority of thread"
        default RT_THREAD_PRIORITY_32

        config RT_THREAD_PRIORITY_8
            bool "8"

        config RT_THREAD_PRIORITY_32
            bool "32"

        config RT_THREAD_PRIORITY_256
            bool "256"
    endchoice

B
bernard 已提交
75
config RT_THREAD_PRIORITY_MAX
76 77 78 79
    int
    default 8   if RT_THREAD_PRIORITY_8
    default 32  if RT_THREAD_PRIORITY_32
    default 256 if RT_THREAD_PRIORITY_256
B
bernard 已提交
80 81 82 83

config RT_TICK_PER_SECOND
    int "Tick frequency, Hz"
    range 10 1000
84
    default 1000
B
bernard 已提交
85 86 87 88 89 90 91
    help
        System's tick frequency, Hz.

config RT_USING_OVERFLOW_CHECK
    bool "Using stack overflow checking"
    default y
    help
92
        Enable thread stack overflow checking. The stack overflow is checking when
93
        each thread switch.
B
bernard 已提交
94 95 96 97

config RT_USING_HOOK
    bool "Enable system hook"
    default y
xpxyr's avatar
xpxyr 已提交
98
    select RT_USING_IDLE_HOOK
B
bernard 已提交
99
    help
100
        Enable the hook function when system running, such as idle thread hook,
101
        thread context switch etc.
102

103 104
    if RT_USING_HOOK
        config RT_HOOK_USING_FUNC_PTR
105 106
            bool "Using function pointers as system hook"
            default y
107
    endif
108

xpxyr's avatar
xpxyr 已提交
109
config RT_USING_IDLE_HOOK
xpxyr's avatar
xpxyr 已提交
110 111
    bool "Enable IDLE Task hook"
    default y if RT_USING_HOOK
xpxyr's avatar
xpxyr 已提交
112 113

    if RT_USING_IDLE_HOOK
114 115 116 117 118 119
        config RT_IDLE_HOOK_LIST_SIZE
            int "The max size of idle hook list"
            default 4
            range 1 16
            help
                The system has a hook list. This is the hook list size.
armink_ztl's avatar
armink_ztl 已提交
120 121
    endif

122
config IDLE_THREAD_STACK_SIZE
123
    int "The stack size of idle thread"
124
    default 1024 if ARCH_CPU_64BIT
125
    default 256
B
bernard 已提交
126

F
fenghuijie 已提交
127 128 129 130 131
config SYSTEM_THREAD_STACK_SIZE
    int "The stack size of system thread (for defunct etc.)"
    depends on RT_USING_SMP
    default IDLE_THREAD_STACK_SIZE

B
bernard 已提交
132 133
config RT_USING_TIMER_SOFT
    bool "Enable software timer with a timer thread"
134
    default y
B
bernard 已提交
135
    help
136
        the timeout function context of soft-timer is under a high priority timer
137
        thread.
B
bernard 已提交
138 139

if RT_USING_TIMER_SOFT
mysterywolf's avatar
mysterywolf 已提交
140 141 142
    config RT_TIMER_THREAD_PRIO
        int "The priority level value of timer thread"
        default 4
B
bernard 已提交
143

mysterywolf's avatar
mysterywolf 已提交
144 145
    config RT_TIMER_THREAD_STACK_SIZE
        int "The stack size of timer thread"
146
        default 2048 if ARCH_CPU_64BIT
mysterywolf's avatar
mysterywolf 已提交
147
        default 512
B
bernard 已提交
148 149
endif

mysterywolf's avatar
mysterywolf 已提交
150 151
menu "kservice optimization"

mysterywolf's avatar
mysterywolf 已提交
152 153
    config RT_KSERVICE_USING_STDLIB
        bool "Enable kservice to use standard C library"
154
        default y
mysterywolf's avatar
mysterywolf 已提交
155

156
    if RT_KSERVICE_USING_STDLIB
157 158
        config RT_KSERVICE_USING_STDLIB_MEMORY
            bool "Use stdlib memory functions to replace (faster, but not safe)"
159
            default n
160 161
            help
                e.g. use memcpy to replace rt_memcpy
162 163
    endif

mysterywolf's avatar
mysterywolf 已提交
164 165 166
    config RT_KSERVICE_USING_TINY_SIZE
        bool "Enable kservice to use tiny size"
        default n
mysterywolf's avatar
mysterywolf 已提交
167

mysterywolf's avatar
mysterywolf 已提交
168 169 170
    config RT_USING_TINY_FFS
        bool "Enable kservice to use tiny finding first bit set method"
        default n
171

172 173 174
    config RT_KPRINTF_USING_LONGLONG
        bool "Enable rt_printf-family functions to support long-long format"
        default y if ARCH_CPU_64BIT
mysterywolf's avatar
mysterywolf 已提交
175
        default n
176 177 178
        help
            Enable rt_printf()/rt_snprintf()/rt_sprintf()/rt_vsnprintf()/rt_vsprintf()
            functions to support long-long format
179

mysterywolf's avatar
mysterywolf 已提交
180 181
endmenu

182 183 184 185 186 187
menuconfig RT_DEBUG
    bool "Enable debugging features"
    default y

if RT_DEBUG

mysterywolf's avatar
mysterywolf 已提交
188 189 190
    config RT_DEBUG_COLOR
        bool "Enable color debugging log"
        default n
191

mysterywolf's avatar
mysterywolf 已提交
192 193 194
    config RT_DEBUG_INIT_CONFIG
        bool "Enable debugging of components initialization"
        default n
195

mysterywolf's avatar
mysterywolf 已提交
196 197 198
    config RT_DEBUG_INIT
        int
        default 1 if RT_DEBUG_INIT_CONFIG
199

mysterywolf's avatar
mysterywolf 已提交
200 201 202
    config RT_DEBUG_THREAD_CONFIG
        bool "Enable debugging of Thread State Changes"
        default n
203

mysterywolf's avatar
mysterywolf 已提交
204 205 206
    config RT_DEBUG_THREAD
        int
        default 1 if RT_DEBUG_THREAD_CONFIG
207

mysterywolf's avatar
mysterywolf 已提交
208 209 210
    config RT_DEBUG_SCHEDULER_CONFIG
        bool "Enable debugging of Scheduler"
        default n
211

mysterywolf's avatar
mysterywolf 已提交
212 213 214
    config RT_DEBUG_SCHEDULER
        int
        default 1 if RT_DEBUG_SCHEDULER_CONFIG
215

mysterywolf's avatar
mysterywolf 已提交
216 217 218
    config RT_DEBUG_IPC_CONFIG
        bool "Enable debugging of IPC"
        default n
219

mysterywolf's avatar
mysterywolf 已提交
220 221 222
    config RT_DEBUG_IPC
        int
        default 1 if RT_DEBUG_IPC_CONFIG
223

mysterywolf's avatar
mysterywolf 已提交
224 225 226
    config RT_DEBUG_TIMER_CONFIG
        bool "Enable debugging of Timer"
        default n
227

mysterywolf's avatar
mysterywolf 已提交
228 229 230
    config RT_DEBUG_TIMER
        int
        default 1 if RT_DEBUG_TIMER_CONFIG
231

mysterywolf's avatar
mysterywolf 已提交
232 233 234
    config RT_DEBUG_IRQ_CONFIG
        bool "Enable debugging of IRQ(Interrupt Request)"
        default n
235

mysterywolf's avatar
mysterywolf 已提交
236 237 238
    config RT_DEBUG_IRQ
        int
        default 1 if RT_DEBUG_IRQ_CONFIG
239

mysterywolf's avatar
mysterywolf 已提交
240 241 242
    config RT_DEBUG_MEM_CONFIG
        bool "Enable debugging of Small Memory Algorithm"
        default n
243

mysterywolf's avatar
mysterywolf 已提交
244 245 246
    config RT_DEBUG_MEM
        int
        default 1 if RT_DEBUG_MEM_CONFIG
247

mysterywolf's avatar
mysterywolf 已提交
248 249 250
    config RT_DEBUG_SLAB_CONFIG
        bool "Enable debugging of SLAB Memory Algorithm"
        default n
251

mysterywolf's avatar
mysterywolf 已提交
252 253 254
    config RT_DEBUG_SLAB
        int
        default 1 if RT_DEBUG_SLAB_CONFIG
255

mysterywolf's avatar
mysterywolf 已提交
256 257 258
    config RT_DEBUG_MEMHEAP_CONFIG
        bool "Enable debugging of Memory Heap Algorithm"
        default n
259

mysterywolf's avatar
mysterywolf 已提交
260 261 262
    config RT_DEBUG_MEMHEAP
        int
        default 1 if RT_DEBUG_MEMHEAP_CONFIG
263

mysterywolf's avatar
mysterywolf 已提交
264 265 266
    config RT_DEBUG_MODULE_CONFIG
        bool "Enable debugging of Application Module"
        default n
267

mysterywolf's avatar
mysterywolf 已提交
268 269 270
    config RT_DEBUG_MODULE
        int
        default 1 if RT_DEBUG_MODULE_CONFIG
271 272 273

endif

B
bernard 已提交
274 275
menu "Inter-Thread communication"

mysterywolf's avatar
mysterywolf 已提交
276 277 278
    config RT_USING_SEMAPHORE
        bool "Enable semaphore"
        default y
B
bernard 已提交
279

mysterywolf's avatar
mysterywolf 已提交
280 281 282
    config RT_USING_MUTEX
        bool "Enable mutex"
        default y
B
bernard 已提交
283

mysterywolf's avatar
mysterywolf 已提交
284 285 286
    config RT_USING_EVENT
        bool "Enable event flag"
        default y
B
bernard 已提交
287

mysterywolf's avatar
mysterywolf 已提交
288 289 290
    config RT_USING_MAILBOX
        bool "Enable mailbox"
        default y
B
bernard 已提交
291

mysterywolf's avatar
mysterywolf 已提交
292 293 294 295 296 297 298 299 300 301 302
    config RT_USING_MESSAGEQUEUE
        bool "Enable message queue"
        default y

    config RT_USING_SIGNALS
        bool "Enable signals"
        select RT_USING_MEMPOOL
        default n
        help
            A signal is an asynchronous notification sent to a specific thread
            in order to notify it of an event that occurred.
B
bernard 已提交
303 304 305 306 307

endmenu

menu "Memory Management"

308 309 310 311 312 313 314 315 316 317
    config RT_PAGE_MAX_ORDER
        int "Max order of pages allocatable by page allocator"
        default 11
        help
            For example, A value of 11 means the maximum chunk of contiguous memory
            allocatable by page system is 2^(11 + ARCH_PAGE_BITS - 1) Bytes.
            Large memory requirement can consume all system resource, and should
            consider reserved memory instead to enhance system endurance.
            Max order should at least satisfied usage by huge page.

B
bernard 已提交
318 319 320 321 322 323
    config RT_USING_MEMPOOL
        bool "Using memory pool"
        default y
        help
            Using static memory fixed partition

324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340
    config RT_USING_SMALL_MEM
        bool "Using Small Memory Algorithm"
        default n
        help
            Using Small Memory Algorithm

    config RT_USING_SLAB
        bool "Using SLAB Memory Algorithm"
        default n
        help
            The slab allocator of RT-Thread is a memory allocation algorithm
             optimizedfor embedded systems based on the slab allocator
             implemented by Matthew Dillon, founder of dragonfly BSD.
             The original slab algorithm is an efficient kernel memory
             allocation algorithm introduced by Jeff bonwick for
             Solaris Operating System.

341
    menuconfig RT_USING_MEMHEAP
342
        bool "Using memheap Memory Algorithm"
B
bernard 已提交
343
        default n
344 345

        if RT_USING_MEMHEAP
346 347 348 349 350 351 352 353 354 355
            choice
                prompt "Memheap memory allocation mode"
                default RT_MEMHEAP_FAST_MODE

                config RT_MEMHEAP_FAST_MODE
                    bool "fast mode"
                    help
                        Speed priority mode.
                        As long as the memory block size meets the requirements, the search ends immediately.

356
                config RT_MEMHEAP_BEST_MODE
357 358 359 360 361
                    bool "best mode"
                    help
                        Best size first.
                        The search does not end until the memory block of the most appropriate size is found
            endchoice
362
        endif
B
bernard 已提交
363

364
    choice
365 366
        prompt "System Heap Memory Management"
        default RT_USING_SMALL_MEM_AS_HEAP
B
bernard 已提交
367

368
        config RT_USING_SMALL_MEM_AS_HEAP
369
            bool "Small Memory Algorithm"
370
            select RT_USING_SMALL_MEM
B
bernard 已提交
371

372
        config RT_USING_MEMHEAP_AS_HEAP
373
            bool "Use memheap objects as heap"
374 375 376 377 378 379 380 381 382 383 384
            select RT_USING_MEMHEAP

            if RT_USING_MEMHEAP_AS_HEAP
                config RT_USING_MEMHEAP_AUTO_BINDING
                    bool "Use all of memheap objects as heap"
                    default y
            endif

        config RT_USING_SLAB_AS_HEAP
            bool "SLAB Algorithm for large memory"
            select RT_USING_SLAB
385 386 387 388 389 390 391 392

        config RT_USING_USERHEAP
            bool "Use user heap"
            help
                If this option is selected, please implement these functions:
                    rt_malloc(), rt_malloc_sethook()
                    rt_free(),   rt_free_sethook()
                    rt_calloc(), rt_realloc()
393
                    rt_memory_info()
394 395
                    rt_system_heap_init()

396 397
        config RT_USING_NOHEAP
            bool "Disable Heap"
398 399
    endchoice

400 401 402 403 404 405 406 407 408 409 410 411 412
    config RT_USING_MEMTRACE
        bool "Enable memory trace"
        default n
        help
            When enable RT_USING_MEMTRACE with shell, developer can call cmd:
            1. memtrace
                to dump memory block information.
            2. memcheck
                to check memory block to avoid memory overwritten.

            And developer also can call memcheck() in each of scheduling
            to check memory block to find which thread has wrongly modified
            memory.
413

414 415 416 417 418 419
    config RT_USING_HEAP_ISR
        bool "Using heap in ISR"
        default n
        help
            When this option is enabled, the critical zone will be protected with disable interrupt.

420
    config RT_USING_HEAP
421
        bool
422 423 424 425
        default n if RT_USING_NOHEAP
        default y if RT_USING_SMALL_MEM
        default y if RT_USING_SLAB
        default y if RT_USING_MEMHEAP_AS_HEAP
426
        default y if RT_USING_USERHEAP
B
bernard 已提交
427 428 429 430 431 432 433 434
endmenu

menu "Kernel Device Object"

    config RT_USING_DEVICE
        bool "Using device object"
        default y

B
Bernard Xiong 已提交
435 436 437 438
    config RT_USING_DEVICE_OPS
        bool "Using ops for each device object"
        default n

G
guo 已提交
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
    config RT_USING_DM
        bool "Enable device driver model with device tree"
        default n
        help
            Enable device driver model with device tree (FDT). It will use more memory
            to parse and support device tree feature.

    config RT_USING_DM_FDT
        bool "Enablie builtin libfdt"
        depends on RT_USING_DM
        default y
        help
            libfdt - Flat Device Tree manipulation. If your code already contains the
            libfdt, you can cancel this built-in libfdt to avoid link issue.

B
bernard 已提交
454 455 456 457 458 459
    config RT_USING_INTERRUPT_INFO
        bool "Enable additional interrupt trace information"
        default n
        help
            Add name and counter information for interrupt trace.

B
bernard 已提交
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
    config RT_USING_CONSOLE
        bool "Using console for rt_kprintf"
        default y

    if RT_USING_CONSOLE
        config RT_CONSOLEBUF_SIZE
            int "the buffer size for console log printf"
            default 128

        config RT_CONSOLE_DEVICE_NAME
            string "the device name for console"
            default "uart"
    endif

endmenu

476 477
config RT_VER_NUM
    hex
478
    default 0x50000
479 480 481
    help
        RT-Thread version number

482 483 484 485
config RT_USING_STDC_ATOMIC
    bool "Use atomic implemented in stdatomic.h"
    default n

B
bernard 已提交
486
endmenu