los_config.h 23.6 KB
Newer Older
W
wenjun 已提交
1
/*
M
mamingshuai 已提交
2 3
 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
W
wenjun 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this list of
 *    conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
 *    of conditions and the following disclaimer in the documentation and/or other materials
 *    provided with the distribution.
 *
 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
 *    to endorse or promote products derived from this software without specific prior written
 *    permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
 * @defgroup los_config System configuration items
 * @ingroup kernel
 */

#ifndef _LOS_CONFIG_H
#define _LOS_CONFIG_H

#include "target_config.h"
C
Caoruihong 已提交
41
#include "los_compiler.h"
W
wenjun 已提交
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */

/* =============================================================================
                                        System clock module configuration
============================================================================= */
/**
 * @ingroup los_config
 * System clock (unit: HZ)
 */
#ifndef OS_SYS_CLOCK
C
Caoruihong 已提交
57
    #error "OS_SYS_CLOCK is system clock rate which should be defined in target_config.h"
W
wenjun 已提交
58 59 60 61 62 63 64
#endif

/**
 * @ingroup los_config
 * Number of Ticks in one second
 */
#ifndef LOSCFG_BASE_CORE_TICK_PER_SECOND
C
Caoruihong 已提交
65
#define LOSCFG_BASE_CORE_TICK_PER_SECOND                    (100UL)
W
wenjun 已提交
66 67
#endif

68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
/**
 * @ingroup los_config
 * Minimum response error accuracy of tick interrupts, number of ticks in one second.
 */
#ifndef LOSCFG_BASE_CORE_TICK_PER_SECOND_MINI
#define LOSCFG_BASE_CORE_TICK_PER_SECOND_MINI               (1000UL) /* 1ms */
#endif

#if (LOSCFG_BASE_CORE_TICK_PER_SECOND > LOSCFG_BASE_CORE_TICK_PER_SECOND_MINI)
    #error "LOSCFG_BASE_CORE_TICK_PER_SECOND_MINI must be greater than LOSCFG_BASE_CORE_TICK_PER_SECOND"
#endif

#if (LOSCFG_BASE_CORE_TICK_PER_SECOND_MINI > 1000UL)
    #error "LOSCFG_BASE_CORE_TICK_PER_SECOND_MINI must be less than or equal to 1000"
#endif

W
wenjun 已提交
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
#if defined(LOSCFG_BASE_CORE_TICK_PER_SECOND) && \
    ((LOSCFG_BASE_CORE_TICK_PER_SECOND < 1UL) || (LOSCFG_BASE_CORE_TICK_PER_SECOND > 1000000000UL))
    #error "LOSCFG_BASE_CORE_TICK_PER_SECOND SHOULD big than 0, and less than 1000000000UL"
#endif


#if (LOSCFG_BASE_CORE_TICK_PER_SECOND <= 1000UL)
/**
 * @ingroup los_config
 * How much time one tick spent (unit:ms)
 */
#ifndef LOSCFG_BASE_CORE_TICK_PERIOD_MS
#define LOSCFG_BASE_CORE_TICK_PERIOD_MS                     (1000UL / LOSCFG_BASE_CORE_TICK_PER_SECOND)
#endif

#elif (LOSCFG_BASE_CORE_TICK_PER_SECOND <= 1000000UL)
/**
 * @ingroup los_config
 * How much time one tick spent (unit:us)
 */
#ifndef LOSCFG_BASE_CORE_TICK_PERIOD_US
#define LOSCFG_BASE_CORE_TICK_PERIOD_US                     (1000000UL / LOSCFG_BASE_CORE_TICK_PER_SECOND)
#endif

#else
/**
 * @ingroup los_config
 * How much time one tick spent (unit:ns)
 */
#ifndef LOSCFG_BASE_CORE_TICK_PERIOD_NS
#define LOSCFG_BASE_CORE_TICK_PERIOD_NS                     (1000000000UL / LOSCFG_BASE_CORE_TICK_PER_SECOND)
#endif
#endif

#ifndef LOSCFG_BASE_CORE_TICK_HW_TIME
C
Caoruihong 已提交
119
#define LOSCFG_BASE_CORE_TICK_HW_TIME                       0
W
wenjun 已提交
120 121
#endif

星e雨's avatar
星e雨 已提交
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
/**
 * @ingroup los_config
 * System timer is a 64/128 bit timer
 */
#ifndef LOSCFG_BASE_CORE_TICK_WTIMER
#define LOSCFG_BASE_CORE_TICK_WTIMER                        0
#endif

/**
 * @ingroup los_config
 * System timer count maximum
 */
#ifndef LOSCFG_BASE_CORE_TICK_RESPONSE_MAX
#define LOSCFG_BASE_CORE_TICK_RESPONSE_MAX                       0
#endif

W
wenjun 已提交
138 139 140 141 142 143 144 145
/* =============================================================================
                                        Hardware interrupt module configuration
============================================================================= */
/**
 * @ingroup los_config
 * Configuration item for hardware interrupt tailoring
 */
#ifndef LOSCFG_PLATFORM_HWI
C
Caoruihong 已提交
146
#define LOSCFG_PLATFORM_HWI                                 1
W
wenjun 已提交
147 148
#endif

149 150 151 152
/**
 * @ingroup los_config
 * Configuration item for using system defined vector base address and interrupt handlers.
 * If LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT is set to 0, vector base address will not be
153 154
 * modified by system. In arm, it should be noted that PendSV_Handler and SysTick_Handler should
 * be redefined to HalPendSV and OsTickHandler respectly in this case, because system depends on
155
 * these interrupt handlers to run normally. What's more, LOS_HwiCreate will not register handler.
156 157 158 159 160 161 162 163 164 165 166
 */
#ifndef LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT
#define LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT                 1
#endif

#if (LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT == 1)
    #if (LOSCFG_PLATFORM_HWI == 0)
        #error "if LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT is set to 1, then LOSCFG_PLATFORM_HWI must also be set to 1"
    #endif
#endif

W
wenjun 已提交
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
/**
 * @ingroup los_config
 * Maximum number of used hardware interrupts, including Tick timer interrupts.
 */
#ifndef LOSCFG_PLATFORM_HWI_LIMIT
#define LOSCFG_PLATFORM_HWI_LIMIT                           32
#endif

/* =============================================================================
                                       Task module configuration
============================================================================= */
/**
 * @ingroup los_config
 * Minimum stack size.
 *
 * 0x80 bytes, aligned on a boundary of 8.
 */
#ifndef LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE
#define LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE                 (ALIGN(0x80, 4))
#endif

/**
 * @ingroup los_config
 * Default task priority
 */
#ifndef LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO
#define LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO                   10
#endif

/**
 * @ingroup los_config
 * Maximum supported number of tasks except the idle task rather than the number of usable tasks
 */
#ifndef LOSCFG_BASE_CORE_TSK_LIMIT
#define LOSCFG_BASE_CORE_TSK_LIMIT                          5
#endif

/**
 * @ingroup los_config
 * Size of the idle task stack
 */
#ifndef LOSCFG_BASE_CORE_TSK_IDLE_STACK_SIZE
#define LOSCFG_BASE_CORE_TSK_IDLE_STACK_SIZE                0x180UL
#endif

/**
 * @ingroup los_config
 * Default task stack size
 */
#ifndef LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE
#define LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE             0x400UL
#endif

/**
 * @ingroup los_config
 * Configuration item for task Robin tailoring
 */
#ifndef LOSCFG_BASE_CORE_TIMESLICE
星e雨's avatar
星e雨 已提交
225
#define LOSCFG_BASE_CORE_TIMESLICE                         1
W
wenjun 已提交
226 227 228 229 230 231 232
#endif

/**
 * @ingroup los_config
 * Longest execution time of tasks with the same priorities
 */
#ifndef LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT
星e雨's avatar
星e雨 已提交
233
#define LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT                  20000 /* 20ms */
W
wenjun 已提交
234 235 236 237 238 239 240
#endif

/**
 * @ingroup los_config
 * Configuration item for task (stack) monitoring module tailoring
 */
#ifndef LOSCFG_BASE_CORE_TSK_MONITOR
C
Caoruihong 已提交
241
#define LOSCFG_BASE_CORE_TSK_MONITOR                        0
W
wenjun 已提交
242 243 244 245 246 247 248
#endif

/**
 * @ingroup los_config
 * Configuration item for task perf task filter hook
 */
#ifndef LOSCFG_BASE_CORE_EXC_TSK_SWITCH
C
Caoruihong 已提交
249
#define LOSCFG_BASE_CORE_EXC_TSK_SWITCH                     0
W
wenjun 已提交
250 251
#endif

252 253 254 255 256 257 258 259
/*
 * @ingroup los_config
 * Configuration item for task context switch hook
 */
#ifndef LOSCFG_BASE_CORE_TSK_SWITCH_HOOK
#define LOSCFG_BASE_CORE_TSK_SWITCH_HOOK()
#endif

W
wenjun 已提交
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
/**
 * @ingroup los_config
 * Define a usable task priority.Highest task priority.
 */
#ifndef LOS_TASK_PRIORITY_HIGHEST
#define LOS_TASK_PRIORITY_HIGHEST                           0
#endif

/**
 * @ingroup los_config
 * Define a usable task priority.Lowest task priority.
 */
#ifndef LOS_TASK_PRIORITY_LOWEST
#define LOS_TASK_PRIORITY_LOWEST                            31
#endif

/**
 * @ingroup los_config
 * Configuration item for task stack independent
 */
#ifndef LOSCFG_BASE_CORE_TASKSTACK_INDEPENDENT
C
Caoruihong 已提交
281
#define LOSCFG_BASE_CORE_TASKSTACK_INDEPENDENT              0
W
wenjun 已提交
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
#endif

/**
 * @ingroup los_config
 * SP align size
 */
#ifndef LOSCFG_STACK_POINT_ALIGN_SIZE
#define LOSCFG_STACK_POINT_ALIGN_SIZE                       8
#endif

/* =============================================================================
                                       Semaphore module configuration
============================================================================= */
/**
 * @ingroup los_config
 * Configuration item for semaphore module tailoring
 */
#ifndef LOSCFG_BASE_IPC_SEM
C
Caoruihong 已提交
300
#define LOSCFG_BASE_IPC_SEM                                 1
W
wenjun 已提交
301 302 303 304 305 306 307 308 309 310
#endif

/**
 * @ingroup los_config
 * Maximum supported number of semaphores
 */
#ifndef LOSCFG_BASE_IPC_SEM_LIMIT
#define LOSCFG_BASE_IPC_SEM_LIMIT                           6
#endif

A
arvinzzz 已提交
311 312 313 314 315 316 317 318
/**
 * @ingroup los_config
 * Maximum number of semaphores.
 */
#ifndef OS_SEM_COUNTING_MAX_COUNT
#define OS_SEM_COUNTING_MAX_COUNT                           0xFFFF
#endif

W
wenjun 已提交
319 320 321 322 323 324 325 326
/* =============================================================================
                                       Mutex module configuration
============================================================================= */
/**
 * @ingroup los_config
 * Configuration item for mutex module tailoring
 */
#ifndef LOSCFG_BASE_IPC_MUX
C
Caoruihong 已提交
327
#define LOSCFG_BASE_IPC_MUX                                 1
W
wenjun 已提交
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
#endif

/**
 * @ingroup los_config
 * Maximum supported number of mutexes
 */
#ifndef LOSCFG_BASE_IPC_MUX_LIMIT
#define LOSCFG_BASE_IPC_MUX_LIMIT                           6
#endif

/* =============================================================================
                                       Queue module configuration
============================================================================= */
/**
 * @ingroup los_config
 * Configuration item for queue module tailoring
 */
#ifndef LOSCFG_BASE_IPC_QUEUE
C
Caoruihong 已提交
346
#define LOSCFG_BASE_IPC_QUEUE                               1
W
wenjun 已提交
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
#endif

/**
 * @ingroup los_config
 * Maximum supported number of queues rather than the number of usable queues
 */
#ifndef LOSCFG_BASE_IPC_QUEUE_LIMIT
#define LOSCFG_BASE_IPC_QUEUE_LIMIT                         6
#endif


/* =============================================================================
                                       Software timer module configuration
============================================================================= */
/**
 * @ingroup los_config
 * Configuration item for software timer module tailoring
 */
#ifndef LOSCFG_BASE_CORE_SWTMR
C
Caoruihong 已提交
366
#define LOSCFG_BASE_CORE_SWTMR                              1
W
wenjun 已提交
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
#endif

/**
 * @ingroup los_config
 * Maximum supported number of software timers rather than the number of usable software timers
 */
#ifndef LOSCFG_BASE_CORE_SWTMR_LIMIT
#define LOSCFG_BASE_CORE_SWTMR_LIMIT                        5
#endif

/**
 * @ingroup los_config
 * Software timer task stack size
 */
#ifndef LOSCFG_BASE_CORE_TSK_SWTMR_STACK_SIZE
#define LOSCFG_BASE_CORE_TSK_SWTMR_STACK_SIZE               LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE
#endif

/**
 * @ingroup los_config
 * Configurate item for software timer align tailoring
 */
#ifndef LOSCFG_BASE_CORE_SWTMR_ALIGN
C
Caoruihong 已提交
390
#define LOSCFG_BASE_CORE_SWTMR_ALIGN                        0
W
wenjun 已提交
391 392
#endif

C
Caoruihong 已提交
393 394
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
    #if (LOSCFG_BASE_CORE_SWTMR == 0)
395
        #error "if LOSCFG_BASE_CORE_SWTMR_ALIGN is set to 1, then LOSCFG_BASE_CORE_SWTMR must also be set to 1"
C
Caoruihong 已提交
396
    #endif
W
wenjun 已提交
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411
#endif

/**
 * @ingroup los_config
 * Maximum size of a software timer queue
 */
#ifndef OS_SWTMR_HANDLE_QUEUE_SIZE
#define OS_SWTMR_HANDLE_QUEUE_SIZE                          (LOSCFG_BASE_CORE_SWTMR_LIMIT + 0)
#endif

/**
 * @ingroup los_config
 * Minimum divisor of software timer multiple alignment
 */
#ifndef LOS_COMMON_DIVISOR
C
Caoruihong 已提交
412
#define LOS_COMMON_DIVISOR                                  10
W
wenjun 已提交
413 414
#endif

C
Caoruihong 已提交
415 416
#if (LOSCFG_BASE_CORE_SWTMR == 1)
    #if (LOSCFG_BASE_IPC_QUEUE == 0)
417
        #error "if LOSCFG_BASE_CORE_SWTMR is set to 1, then LOSCFG_BASE_IPC_QUEUE must also be set to 1"
C
Caoruihong 已提交
418
    #endif
W
wenjun 已提交
419 420
#endif
/* =============================================================================
C
Caoruihong 已提交
421
                                       Memory module configuration ---- to be refactored
W
wenjun 已提交
422 423 424 425 426
============================================================================= */
extern UINT8 *m_aucSysMem0;

/**
 * @ingroup los_config
427
 * Configure whether the kernel uses external heap memory
W
wenjun 已提交
428
 */
429 430
#ifndef LOSCFG_SYS_EXTERNAL_HEAP
#define LOSCFG_SYS_EXTERNAL_HEAP                            0
W
wenjun 已提交
431 432 433 434
#endif

/**
 * @ingroup los_config
435
 * Starting address of the memory
W
wenjun 已提交
436
 */
437 438
#ifndef LOSCFG_SYS_HEAP_ADDR
#define LOSCFG_SYS_HEAP_ADDR                                (&m_aucSysMem0[0])
W
wenjun 已提交
439 440 441 442
#endif

/**
 * @ingroup los_config
443
 * Starting address of the task stack
W
wenjun 已提交
444
 */
445 446 447
#ifndef OS_TASK_STACK_ADDR
#define OS_TASK_STACK_ADDR                                  LOSCFG_SYS_HEAP_ADDR
#endif
W
wenjun 已提交
448 449 450 451 452

/**
 * @ingroup los_config
 * Memory size
 */
453 454
#ifndef LOSCFG_SYS_HEAP_SIZE
#define LOSCFG_SYS_HEAP_SIZE                                0x10000UL
W
wenjun 已提交
455 456 457 458 459 460 461
#endif

/**
 * @ingroup los_config
 * Configuration module tailoring of more mempry pool checking
 */
#ifndef LOSCFG_MEM_MUL_POOL
C
Caoruihong 已提交
462
#define LOSCFG_MEM_MUL_POOL                                 1
W
wenjun 已提交
463 464
#endif

465 466 467 468 469 470 471 472
/**
 * @ingroup los_config
 * Configuration module tailoring of memory released by task id
 */
#ifndef LOSCFG_MEM_FREE_BY_TASKID
#define LOSCFG_MEM_FREE_BY_TASKID                           0
#endif

W
wenjun 已提交
473 474 475 476 477
/**
 * @ingroup los_config
 * Configuration module tailoring of mem node integrity checking
 */
#ifndef LOSCFG_BASE_MEM_NODE_INTEGRITY_CHECK
C
Caoruihong 已提交
478
#define LOSCFG_BASE_MEM_NODE_INTEGRITY_CHECK                0
W
wenjun 已提交
479 480 481 482
#endif

/**
 * @ingroup los_config
483
 * Configuration memory leak detection
M
mamingshuai 已提交
484 485
 * @attention
 * Need to enable backtrace module synchronously by configuration LOSCFG_BACKTRACE_TYPE,
zhushy_'s avatar
zhushy_ 已提交
486
 * and call OSBackTraceInit to complete initialization before the memory pool is initialized.
W
wenjun 已提交
487
 */
488 489
#ifndef LOSCFG_MEM_LEAKCHECK
#define LOSCFG_MEM_LEAKCHECK                                0
zhushy_'s avatar
zhushy_ 已提交
490
#endif
R
rtos-lover 已提交
491 492 493

#if (LOSCFG_MEM_LEAKCHECK == 1) && (LOSCFG_BACKTRACE_TYPE == 0)
    #error "if LOSCFG_MEM_LEAKCHECK is set to 1, then LOSCFG_BACKTRACE_TYPE must be set to 1, 2 or 3."
W
wenjun 已提交
494 495
#endif

M
mamingshuai 已提交
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516
/**
 * @ingroup los_config
 * The default is 4, which means that the function call stack is recorded from the kernel interface,
 * such as LOS_MemAlloc/LOS_MemAllocAlign/LOS_MemRealloc/LOS_MemFree. If you want to further ignore
 * the number of function call layers, you can increase this value appropriately.
 * @attention
 * The default is in the IAR tool. Under different compilation environments, this value needs to be adjusted.
 */
#ifndef LOSCFG_MEM_OMIT_LR_CNT
#define LOSCFG_MEM_OMIT_LR_CNT                              4
#endif

/**
 * @ingroup los_config
 * The record number of layers of the function call relationship starting from the number of
 * ignored layers(LOSCFG_MEM_OMIT_LR_CNT).
 */
#ifndef LOSCFG_MEM_RECORD_LR_CNT
#define LOSCFG_MEM_RECORD_LR_CNT                            3
#endif

W
wenjun 已提交
517 518
/**
 * @ingroup los_config
519
 * Configuration memory leak recorded num
W
wenjun 已提交
520
 */
521 522
#ifndef LOSCFG_MEM_LEAKCHECK_RECORD_MAX_NUM
#define LOSCFG_MEM_LEAKCHECK_RECORD_MAX_NUM                 1024
W
wenjun 已提交
523 524 525 526
#endif

/**
 * @ingroup los_config
527
 * Configuration of memory pool record memory consumption waterline
W
wenjun 已提交
528
 */
529 530
#ifndef LOSCFG_MEM_WATERLINE
#define LOSCFG_MEM_WATERLINE                                1
W
wenjun 已提交
531 532 533 534
#endif

/**
 * @ingroup los_config
535
 * Number of memory checking blocks
W
wenjun 已提交
536
 */
537 538
#ifndef OS_SYS_MEM_NUM
#define OS_SYS_MEM_NUM                                      20
W
wenjun 已提交
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564
#endif

/**
 * @ingroup los_config
 * Size of unaligned memory
 */
#ifndef OS_SYS_NOCACHEMEM_SIZE
#define OS_SYS_NOCACHEMEM_SIZE                              0x0UL
#endif

/**
 * @ingroup los_config
 * Starting address of the unaligned memory
 */
#if (OS_SYS_NOCACHEMEM_SIZE > 0)
#define OS_SYS_NOCACHEMEM_ADDR                              (&g_sysNoCacheMem0[0])
#endif

/* =============================================================================
                                        Exception module configuration
============================================================================= */
/**
 * @ingroup los_config
 * Configuration item for exception tailoring
 */
#ifndef LOSCFG_PLATFORM_EXC
C
Caoruihong 已提交
565
#define LOSCFG_PLATFORM_EXC                                 0
W
wenjun 已提交
566 567 568 569 570 571
#endif

/**
 * @ingroup los_config
 * Configuration of hardware stack protection
 */
zhushy_'s avatar
zhushy_ 已提交
572 573
#ifndef LOSCFG_EXC_HARDWARE_STACK_PROTECTION
#define LOSCFG_EXC_HARDWARE_STACK_PROTECTION                0
W
wenjun 已提交
574 575 576
#endif

/* =============================================================================
A
arvinzzz 已提交
577
                                        CPUP module configuration
W
wenjun 已提交
578 579 580 581 582 583
============================================================================= */
/**
 * @ingroup los_config
 * Configuration item for CPU usage tailoring
 */
#ifndef LOSCFG_BASE_CORE_CPUP
C
Caoruihong 已提交
584
#define LOSCFG_BASE_CORE_CPUP                               0
W
wenjun 已提交
585 586 587 588 589 590 591 592 593
#endif

/* =============================================================================
                                       Test module configuration
============================================================================= */
/**
 * @ingroup los_config
 * Configuration test case to open
 */
A
arvinzzz 已提交
594 595 596
#ifndef LOSCFG_TEST
#define LOSCFG_TEST                                         0
#endif
W
wenjun 已提交
597 598 599 600 601 602

/**
 * @ingroup los_config
 * Configuration CMSIS_OS_VER
 */
#ifndef CMSIS_OS_VER
603
#define CMSIS_OS_VER                                        2
W
wenjun 已提交
604 605 606
#endif

/* =============================================================================
A
arvinzzz 已提交
607
                                       Fs module configuration
W
wenjun 已提交
608
============================================================================= */
A
arvinzzz 已提交
609 610
#ifndef LOSCFG_SUPPORT_FATFS
#define LOSCFG_SUPPORT_FATFS                                0
W
wenjun 已提交
611 612
#endif

613 614 615
#ifndef LOSCFG_SUPPORT_LITTLEFS
#define LOSCFG_SUPPORT_LITTLEFS                             1
#endif
616 617 618 619 620

#ifndef LOSCFG_LFS_MAX_MOUNT_SIZE
#define LOSCFG_LFS_MAX_MOUNT_SIZE                           3
#endif

A
arvinzzz 已提交
621 622 623
/* =============================================================================
                                       Trace module configuration
============================================================================= */
A
arvinzzz 已提交
624 625 626 627 628 629 630 631
/**
 * @ingroup los_config
 * Configuration trace tool
 */
#ifndef LOSCFG_DEBUG_HOOK
#define LOSCFG_DEBUG_HOOK                                   0
#endif

L
LiteOS2021 已提交
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677
#if (LOSCFG_DEBUG_HOOK == 1)
#ifndef LOSCFG_KERNEL_TRACE
#define LOSCFG_KERNEL_TRACE                                 0
#endif
#endif

#if (LOSCFG_KERNEL_TRACE == 1)

#ifndef LOSCFG_TRACE_FRAME_MAX_PARAMS
#define LOSCFG_TRACE_FRAME_MAX_PARAMS                       3
#endif

#ifndef LOSCFG_TRACE_FRAME_EVENT_COUNT
#define LOSCFG_TRACE_FRAME_EVENT_COUNT                      0
#endif

#ifndef LOSCFG_RECORDER_MODE_OFFLINE
#define LOSCFG_RECORDER_MODE_OFFLINE                        1
#endif

#ifndef LOSCFG_RECORDER_MODE_ONLINE
#define LOSCFG_RECORDER_MODE_ONLINE                         0
#endif

#if (!(LOSCFG_RECORDER_MODE_OFFLINE ^ LOSCFG_RECORDER_MODE_ONLINE))
#error One of LOSCFG_RECORDER_MODE_OFFLINE and LOSCFG_RECORDER_MODE_ONLINE should be set to 1 and only.
#endif

#ifndef LOSCFG_TRACE_CLIENT_INTERACT
#define LOSCFG_TRACE_CLIENT_INTERACT                        1
#endif

#ifndef LOSCFG_TRACE_BUFFER_SIZE
#define LOSCFG_TRACE_BUFFER_SIZE                            2048
#endif

#ifndef NUM_HAL_INTERRUPT_UART
#define NUM_HAL_INTERRUPT_UART                              0xff
#endif

#ifndef OS_TICK_INT_NUM
#define OS_TICK_INT_NUM                                     0xff
#endif

#endif

678
/* =============================================================================
A
arvinzzz 已提交
679
                                       PM module configuration
680 681 682
============================================================================= */
/**
 * @ingroup los_config
A
arvinzzz 已提交
683
 * Configuration item for low power frame tailoring
684
 */
A
arvinzzz 已提交
685 686
#ifndef LOSCFG_KERNEL_PM
#define LOSCFG_KERNEL_PM                                     1
687
#endif
W
wenjun 已提交
688

M
mamingshuai 已提交
689 690
/**
 * @ingroup los_config
A
arvinzzz 已提交
691
 * Configuration item for priority of low-power task.
M
mamingshuai 已提交
692
 */
A
arvinzzz 已提交
693 694
#ifndef LOSCFG_KERNEL_PM_TASK_PTIORITY
#define LOSCFG_KERNEL_PM_TASK_PTIORITY                       1
M
mamingshuai 已提交
695 696 697 698
#endif

/**
 * @ingroup los_config
A
arvinzzz 已提交
699
 * Configuration item for stack size of low-power task.
M
mamingshuai 已提交
700
 */
A
arvinzzz 已提交
701 702
#ifndef LOSCFG_KERNEL_PM_TASK_STACKSIZE
#define LOSCFG_KERNEL_PM_TASK_STACKSIZE                      0x800
M
mamingshuai 已提交
703 704
#endif

星e雨's avatar
星e雨 已提交
705 706
/**
 * @ingroup los_config
A
arvinzzz 已提交
707
 * Configuration item for low power frame debug tailoring
星e雨's avatar
星e雨 已提交
708
 */
A
arvinzzz 已提交
709 710
#ifndef LOSCFG_KERNEL_PM_DEBUG
#define LOSCFG_KERNEL_PM_DEBUG                               0
Z
zhushengle 已提交
711 712
#endif

A
arvinzzz 已提交
713 714 715
/* =============================================================================
                                       printf configuration
============================================================================= */
Z
zhushengle 已提交
716 717
/**
 * @ingroup los_config
A
arvinzzz 已提交
718
 * Configuration liteos printf
Z
zhushengle 已提交
719
 */
A
arvinzzz 已提交
720 721
#ifndef LOSCFG_KERNEL_PRINTF
#define LOSCFG_KERNEL_PRINTF                                1
Z
zhushengle 已提交
722 723
#endif

A
arvinzzz 已提交
724 725 726
/* =============================================================================
                                       backtrace configuration
============================================================================= */
Z
zhushengle 已提交
727 728
/**
 * @ingroup los_config
A
arvinzzz 已提交
729 730 731 732 733 734
 * Configuration backtrace type
 * 0: Close stack analysis module.
 * 1: Call stack analysis for cortex-m series by scanning the stack.
 * 2: Call stack analysis for risc-v by using frame pointer.
 * 3: Call stack analysis for risc-v by scanning the stack.
 * others: Not currently supported.
Z
zhushengle 已提交
735
 */
A
arvinzzz 已提交
736 737
#ifndef LOSCFG_BACKTRACE_TYPE
#define LOSCFG_BACKTRACE_TYPE                                0
Z
zhushengle 已提交
738 739 740 741
#endif

/**
 * @ingroup los_config
A
arvinzzz 已提交
742
 * Configuration backtrace depth.
Z
zhushengle 已提交
743
 */
A
arvinzzz 已提交
744 745
#ifndef LOSCFG_BACKTRACE_DEPTH
#define LOSCFG_BACKTRACE_DEPTH                               15
星e雨's avatar
星e雨 已提交
746 747
#endif

A
arvinzzz 已提交
748 749 750
/* =============================================================================
                                       trustzone configuration
============================================================================= */
Y
YOUR_NAME 已提交
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767
/**
 * @ingroup los_config
 * Configuration trustzone secure heap size.
 */
#ifndef LOSCFG_SECURE_HEAP_SIZE
#define LOSCFG_SECURE_HEAP_SIZE                              2048
#endif

/**
 * @ingroup los_config
 * Configuration trustzone secure stack default size.
 * The secure stack must be allocated before the task calls non-secure callble functions.
 */
#ifndef LOSCFG_SECURE_STACK_DEFAULT_SIZE
#define LOSCFG_SECURE_STACK_DEFAULT_SIZE                     512
#endif

W
wenjun 已提交
768 769 770 771 772 773 774 775
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */


#endif /* _LOS_CONFIG_H */