00001 /*---------------------------------------------------------------------------- 00002 * Copyright (c) <2013-2015>, <Huawei Technologies Co., Ltd> 00003 * All rights reserved. 00004 * Redistribution and use in source and binary forms, with or without modification, 00005 * are permitted provided that the following conditions are met: 00006 * 1. Redistributions of source code must retain the above copyright notice, this list of 00007 * conditions and the following disclaimer. 00008 * 2. Redistributions in binary form must reproduce the above copyright notice, this list 00009 * of conditions and the following disclaimer in the documentation and/or other materials 00010 * provided with the distribution. 00011 * 3. Neither the name of the copyright holder nor the names of its contributors may be used 00012 * to endorse or promote products derived from this software without specific prior written 00013 * permission. 00014 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00015 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00016 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00017 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 00018 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00019 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00020 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00021 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00022 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00023 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 00024 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 *---------------------------------------------------------------------------*/ 00026 /*---------------------------------------------------------------------------- 00027 * Notice of Export Control Law 00028 * =============================================== 00029 * Huawei LiteOS may be subject to applicable export control laws and regulations, which might 00030 * include those applicable to Huawei LiteOS of U.S. and the country in which you are located. 00031 * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such 00032 * applicable export control laws and regulations. 00033 *---------------------------------------------------------------------------*/ 00034 00035 /**@defgroup los_config System configuration items 00036 * @ingroup kernel 00037 */ 00038 00039 #ifndef _LOS_CONFIG_H 00040 #define _LOS_CONFIG_H 00041 00042 #include "los_typedef.h" 00043 #include "target_config.h" 00044 00045 #ifdef __cplusplus 00046 #if __cplusplus 00047 extern "C" { 00048 #endif /* __cplusplus */ 00049 #endif /* __cplusplus */ 00050 00051 00052 /*============================================================================= 00053 System clock module configuration 00054 =============================================================================*/ 00055 00056 /** 00057 * @ingroup los_config 00058 * System clock (unit: HZ) 00059 */ 00060 #ifndef OS_SYS_CLOCK 00061 #define OS_SYS_CLOCK (100000000UL) 00062 #endif 00063 00064 /** 00065 * @ingroup los_config 00066 * timer1 clock (unit: HZ) 00067 */ 00068 #ifndef OS_TIME_TIMER_CLOCK 00069 #define OS_TIME_TIMER_CLOCK OS_SYS_CLOCK 00070 #endif 00071 00072 /** 00073 * @ingroup los_config 00074 * Number of Ticks in one second 00075 */ 00076 #ifndef LOSCFG_BASE_CORE_TICK_PER_SECOND 00077 #define LOSCFG_BASE_CORE_TICK_PER_SECOND (1000UL) 00078 #endif 00079 00080 #if defined(LOSCFG_BASE_CORE_TICK_PER_SECOND) \ 00081 && ((LOSCFG_BASE_CORE_TICK_PER_SECOND < 1UL) || (LOSCFG_BASE_CORE_TICK_PER_SECOND > 1000000000UL)) 00082 #error "LOSCFG_BASE_CORE_TICK_PER_SECOND SHOULD big than 0, and less than 1000000000UL" 00083 #endif 00084 00085 00086 #if (LOSCFG_BASE_CORE_TICK_PER_SECOND <= 1000UL) 00087 /** 00088 * @ingroup los_config 00089 * How much time one tick spent (unit:ms) 00090 */ 00091 #ifndef LOSCFG_BASE_CORE_TICK_PERIOD_MS 00092 #define LOSCFG_BASE_CORE_TICK_PERIOD_MS (1000UL / LOSCFG_BASE_CORE_TICK_PER_SECOND) 00093 #endif 00094 00095 #elif (LOSCFG_BASE_CORE_TICK_PER_SECOND <= 1000000UL) 00096 /** 00097 * @ingroup los_config 00098 * How much time one tick spent (unit:us) 00099 */ 00100 #ifndef LOSCFG_BASE_CORE_TICK_PERIOD_US 00101 #define LOSCFG_BASE_CORE_TICK_PERIOD_US (1000000UL / LOSCFG_BASE_CORE_TICK_PER_SECOND) 00102 #endif 00103 00104 #else 00105 /** 00106 * @ingroup los_config 00107 * How much time one tick spent (unit:ns) 00108 */ 00109 #ifndef LOSCFG_BASE_CORE_TICK_PERIOD_NS 00110 #define LOSCFG_BASE_CORE_TICK_PERIOD_NS (1000000000UL / LOSCFG_BASE_CORE_TICK_PER_SECOND) 00111 #endif 00112 #endif 00113 00114 /** 00115 * @ingroup los_config 00116 * External configuration item for timer tailoring 00117 */ 00118 #ifndef LOSCFG_BASE_CORE_TICK_HW_TIME1 00119 #define LOSCFG_BASE_CORE_TICK_HW_TIME1 YES 00120 #endif 00121 00122 #ifndef LOSCFG_BASE_CORE_TICK_HW_TIME 00123 #define LOSCFG_BASE_CORE_TICK_HW_TIME NO 00124 #endif 00125 00126 /** 00127 * @ingroup los_config 00128 * Configuration liteos kernel tickless 00129 */ 00130 #ifndef LOSCFG_KERNEL_TICKLESS 00131 #define LOSCFG_KERNEL_TICKLESS NO 00132 #endif 00133 00134 /** 00135 * @ingroup los_config 00136 * External configuration item for timer interrupt number 00137 */ 00138 #ifndef LOSCFG_BASE_TIMER_INT_NUM 00139 #define LOSCFG_BASE_TIMER_INT_NUM (15) 00140 #endif 00141 00142 00143 /*============================================================================= 00144 Hardware interrupt module configuration 00145 =============================================================================*/ 00146 00147 /** 00148 * @ingroup los_config 00149 * Configuration item for hardware interrupt tailoring 00150 */ 00151 #ifndef LOSCFG_PLATFORM_HWI 00152 #define LOSCFG_PLATFORM_HWI YES 00153 #endif 00154 00155 /** 00156 * @ingroup los_config 00157 * Maximum number of used hardware interrupts, including Tick timer interrupts. 00158 */ 00159 #ifndef LOSCFG_PLATFORM_HWI_LIMIT 00160 #define LOSCFG_PLATFORM_HWI_LIMIT 32 00161 #endif 00162 00163 00164 /*============================================================================= 00165 Task module configuration 00166 =============================================================================*/ 00167 00168 /** 00169 * @ingroup los_config 00170 * Minimum stack size. 00171 * 00172 * 0x80 bytes, aligned on a boundary of 8. 00173 */ 00174 #ifndef LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE 00175 #define LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE (ALIGN(0x80, 4)) 00176 #endif 00177 00178 /** 00179 * @ingroup los_config 00180 * Default task priority 00181 */ 00182 #ifndef LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO 00183 #define LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO 10 00184 #endif 00185 00186 /** 00187 * @ingroup los_config 00188 * Maximum supported number of tasks except the idle task rather than the number of usable tasks 00189 */ 00190 #ifndef LOSCFG_BASE_CORE_TSK_LIMIT 00191 #define LOSCFG_BASE_CORE_TSK_LIMIT 5 00192 #endif 00193 00194 /** 00195 * @ingroup los_config 00196 * Size of the idle task stack 00197 */ 00198 #ifndef LOSCFG_BASE_CORE_TSK_IDLE_STACK_SIZE 00199 #define LOSCFG_BASE_CORE_TSK_IDLE_STACK_SIZE (0x180UL) 00200 #endif 00201 00202 /** 00203 * @ingroup los_config 00204 * Default task stack size 00205 */ 00206 #ifndef LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE 00207 #define LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE (0x400UL) 00208 #endif 00209 00210 /** 00211 * @ingroup los_config 00212 * Configuration item for task Robin tailoring 00213 */ 00214 #ifndef LOSCFG_BASE_CORE_TIMESLICE 00215 #define LOSCFG_BASE_CORE_TIMESLICE YES 00216 #endif 00217 00218 /** 00219 * @ingroup los_config 00220 * Longest execution time of tasks with the same priorities 00221 */ 00222 #ifndef LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT 00223 #define LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT 10 00224 #endif 00225 00226 /** 00227 * @ingroup los_config 00228 * Configuration item for task (stack) monitoring module tailoring 00229 */ 00230 #ifndef LOSCFG_BASE_CORE_TSK_MONITOR 00231 #define LOSCFG_BASE_CORE_TSK_MONITOR NO 00232 #endif 00233 00234 /** 00235 * @ingroup los_config 00236 * Configuration item for task perf task filter hook 00237 */ 00238 #ifndef LOSCFG_BASE_CORE_EXC_TSK_SWITCH 00239 #define LOSCFG_BASE_CORE_EXC_TSK_SWITCH NO 00240 #endif 00241 00242 /** 00243 * @ingroup los_config 00244 * Define a usable task priority.Highest task priority. 00245 */ 00246 #ifndef LOS_TASK_PRIORITY_HIGHEST 00247 #define LOS_TASK_PRIORITY_HIGHEST 0 00248 #endif 00249 00250 /** 00251 * @ingroup los_config 00252 * Define a usable task priority.Lowest task priority. 00253 */ 00254 #ifndef LOS_TASK_PRIORITY_LOWEST 00255 #define LOS_TASK_PRIORITY_LOWEST 31 00256 #endif 00257 00258 /** 00259 * @ingroup los_config 00260 * Configuration item for task stack independent 00261 */ 00262 #ifndef LOSCFG_BASE_CORE_TASKSTACK_INDEPENDENT 00263 #define LOSCFG_BASE_CORE_TASKSTACK_INDEPENDENT NO 00264 #endif 00265 00266 /** 00267 * @ingroup los_config 00268 * SP align size 00269 */ 00270 #ifndef LOSCFG_STACK_POINT_ALIGN_SIZE 00271 #define LOSCFG_STACK_POINT_ALIGN_SIZE 8 00272 #endif 00273 00274 /*============================================================================= 00275 Semaphore module configuration 00276 =============================================================================*/ 00277 00278 /** 00279 * @ingroup los_config 00280 * Configuration item for semaphore module tailoring 00281 */ 00282 #ifndef LOSCFG_BASE_IPC_SEM 00283 #define LOSCFG_BASE_IPC_SEM YES 00284 #endif 00285 00286 /** 00287 * @ingroup los_config 00288 * Maximum supported number of semaphores 00289 */ 00290 #ifndef LOSCFG_BASE_IPC_SEM_LIMIT 00291 #define LOSCFG_BASE_IPC_SEM_LIMIT 6 00292 #endif 00293 00294 /*============================================================================= 00295 Mutex module configuration 00296 =============================================================================*/ 00297 00298 /** 00299 * @ingroup los_config 00300 * Configuration item for mutex module tailoring 00301 */ 00302 #ifndef LOSCFG_BASE_IPC_MUX 00303 #define LOSCFG_BASE_IPC_MUX YES 00304 #endif 00305 00306 /** 00307 * @ingroup los_config 00308 * Maximum supported number of mutexes 00309 */ 00310 #ifndef LOSCFG_BASE_IPC_MUX_LIMIT 00311 #define LOSCFG_BASE_IPC_MUX_LIMIT 6 00312 #endif 00313 00314 /*============================================================================= 00315 Queue module configuration 00316 =============================================================================*/ 00317 00318 /** 00319 * @ingroup los_config 00320 * Configuration item for queue module tailoring 00321 */ 00322 #ifndef LOSCFG_BASE_IPC_QUEUE 00323 #define LOSCFG_BASE_IPC_QUEUE YES 00324 #endif 00325 00326 /** 00327 * @ingroup los_config 00328 * Maximum supported number of queues rather than the number of usable queues 00329 */ 00330 #ifndef LOSCFG_BASE_IPC_QUEUE_LIMIT 00331 #define LOSCFG_BASE_IPC_QUEUE_LIMIT 6 00332 #endif 00333 00334 00335 /*============================================================================= 00336 Software timer module configuration 00337 =============================================================================*/ 00338 00339 /** 00340 * @ingroup los_config 00341 * Configuration item for software timer module tailoring 00342 */ 00343 #ifndef LOSCFG_BASE_CORE_SWTMR 00344 #define LOSCFG_BASE_CORE_SWTMR YES 00345 #endif 00346 00347 /** 00348 * @ingroup los_config 00349 * Maximum supported number of software timers rather than the number of usable software timers 00350 */ 00351 #ifndef LOSCFG_BASE_CORE_SWTMR_LIMIT 00352 #define LOSCFG_BASE_CORE_SWTMR_LIMIT 5 00353 #endif 00354 00355 /** 00356 * @ingroup los_config 00357 * Software timer task stack size 00358 */ 00359 #ifndef LOSCFG_BASE_CORE_TSK_SWTMR_STACK_SIZE 00360 #define LOSCFG_BASE_CORE_TSK_SWTMR_STACK_SIZE LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE 00361 #endif 00362 00363 /** 00364 * @ingroup los_config 00365 * Configurate item for handling software timer interrupt in task tailoring 00366 */ 00367 #ifndef LOSCFG_BASE_CORE_SWTMR_TASK 00368 #define LOSCFG_BASE_CORE_SWTMR_TASK YES 00369 #endif 00370 00371 /** 00372 * @ingroup los_config 00373 * Configurate item for software timer align tailoring 00374 */ 00375 #ifndef LOSCFG_BASE_CORE_SWTMR_ALIGN 00376 #define LOSCFG_BASE_CORE_SWTMR_ALIGN NO 00377 #endif 00378 00379 #if(LOSCFG_BASE_CORE_SWTMR == NO && LOSCFG_BASE_CORE_SWTMR_ALIGN == YES) 00380 #error "swtmr align first need support swmtr, should make LOSCFG_BASE_CORE_SWTMR = YES" 00381 #endif 00382 00383 /** 00384 * @ingroup los_config 00385 * Max number of software timers ID 00386 */ 00387 #ifndef OS_SWTMR_MAX_TIMERID 00388 #define OS_SWTMR_MAX_TIMERID ((65535 / LOSCFG_BASE_CORE_SWTMR_LIMIT) * LOSCFG_BASE_CORE_SWTMR_LIMIT) 00389 #endif 00390 00391 /** 00392 * @ingroup los_config 00393 * Maximum size of a software timer queue 00394 */ 00395 #ifndef OS_SWTMR_HANDLE_QUEUE_SIZE 00396 #define OS_SWTMR_HANDLE_QUEUE_SIZE (LOSCFG_BASE_CORE_SWTMR_LIMIT + 0) 00397 #endif 00398 00399 /** 00400 * @ingroup los_config 00401 * Minimum divisor of software timer multiple alignment 00402 */ 00403 #ifndef LOS_COMMON_DIVISOR 00404 #define LOS_COMMON_DIVISOR 10 00405 #endif 00406 00407 /*============================================================================= 00408 Memory module configuration 00409 =============================================================================*/ 00410 00411 extern UINT8 *m_aucSysMem0; 00412 00413 /** 00414 * @ingroup los_config 00415 * Starting address of the memory 00416 */ 00417 #ifndef OS_SYS_MEM_ADDR 00418 #define OS_SYS_MEM_ADDR (&m_aucSysMem0[0]) 00419 #endif 00420 00421 /** 00422 * @ingroup los_config 00423 * Starting address of the task stack 00424 */ 00425 #ifndef OS_TASK_STACK_ADDR 00426 #define OS_TASK_STACK_ADDR OS_SYS_MEM_ADDR 00427 #endif 00428 00429 /** 00430 * @ingroup los_config 00431 * Ending address of the memory 00432 */ 00433 extern UINT32 g_sys_mem_addr_end; 00434 00435 00436 /** 00437 * @ingroup los_config 00438 * Memory size 00439 */ 00440 #ifndef OS_SYS_MEM_SIZE 00441 #define OS_SYS_MEM_SIZE (0x10000UL) 00442 #endif 00443 00444 #ifndef LOSCFG_MEMORY_BESTFIT 00445 #define LOSCFG_MEMORY_BESTFIT YES 00446 #endif 00447 00448 /** 00449 * @ingroup los_config 00450 * Configuration module tailoring of more mempry pool checking 00451 */ 00452 #ifndef LOSCFG_MEM_MUL_POOL 00453 #define LOSCFG_MEM_MUL_POOL NO 00454 #endif 00455 00456 /** 00457 * @ingroup los_config 00458 * Configuration module tailoring of slab memory 00459 */ 00460 #ifndef LOSCFG_KERNEL_MEM_SLAB 00461 #define LOSCFG_KERNEL_MEM_SLAB YES 00462 #endif 00463 00464 /** 00465 * @ingroup los_config 00466 * Configuration module tailoring of mem node integrity checking 00467 */ 00468 #ifndef LOSCFG_BASE_MEM_NODE_INTEGRITY_CHECK 00469 #define LOSCFG_BASE_MEM_NODE_INTEGRITY_CHECK NO 00470 #endif 00471 00472 /** 00473 * @ingroup los_config 00474 * Configuration module tailoring of mem node size checking 00475 */ 00476 #ifndef LOSCFG_BASE_MEM_NODE_SIZE_CHECK 00477 #define LOSCFG_BASE_MEM_NODE_SIZE_CHECK YES 00478 #endif 00479 00480 /** 00481 * @ingroup los_config 00482 * Number of memory checking blocks 00483 */ 00484 #ifndef OS_SYS_MEM_NUM 00485 #define OS_SYS_MEM_NUM 20 00486 #endif 00487 00488 /** 00489 * @ingroup los_config 00490 * Configuration heap memory peak statistics 00491 */ 00492 #ifndef LOSCFG_HEAP_MEMORY_PEAK_STATISTICS 00493 #define LOSCFG_HEAP_MEMORY_PEAK_STATISTICS YES 00494 #endif 00495 00496 /** 00497 * @ingroup los_config 00498 * Size of unaligned memory 00499 */ 00500 #ifndef OS_SYS_NOCACHEMEM_SIZE 00501 #define OS_SYS_NOCACHEMEM_SIZE 0x0UL 00502 #endif 00503 00504 /** 00505 * @ingroup los_config 00506 * Starting address of the unaligned memory 00507 */ 00508 #if (OS_SYS_NOCACHEMEM_SIZE > 0) 00509 #define OS_SYS_NOCACHEMEM_ADDR &m_aucSysNoCacheMem0[0] 00510 #endif 00511 00512 00513 /*============================================================================= 00514 Exception module configuration 00515 =============================================================================*/ 00516 00517 /** 00518 * @ingroup los_config 00519 * Configuration item for exception tailoring 00520 */ 00521 #ifndef LOSCFG_PLATFORM_EXC 00522 #define LOSCFG_PLATFORM_EXC NO 00523 #endif 00524 00525 /** 00526 * @ingroup los_config 00527 * Configuration of hardware stack protection 00528 */ 00529 #ifndef LOSCFG_EXC_HRADWARE_STACK_PROTECTION 00530 #define LOSCFG_EXC_HRADWARE_STACK_PROTECTION NO 00531 #endif 00532 00533 /*============================================================================= 00534 MPU module configuration 00535 =============================================================================*/ 00536 /** 00537 * @ingroup los_config 00538 * Configuration item for MPU 00539 */ 00540 #ifndef LOSCFG_BASE_CORE_MPU 00541 #define LOSCFG_BASE_CORE_MPU NO 00542 #endif 00543 00544 /** 00545 * @ingroup los_config 00546 * MPU support number : MPU maximum number of region support(According to the cotex-m4 authority Guide) 00547 */ 00548 #ifndef LOSCFG_MPU_MAX_SUPPORT 00549 #define LOSCFG_MPU_MAX_SUPPORT 8 00550 #endif 00551 00552 /** 00553 * @ingroup los_config 00554 * MPU support address range : from LOSCFG_MPU_MIN_ADDRESS to LOSCFG_MPU_MAX_ADDRESS 00555 */ 00556 #ifndef LOSCFG_MPU_MIN_ADDRESS 00557 #define LOSCFG_MPU_MIN_ADDRESS 0x0UL // Minimum protected address 00558 #endif 00559 00560 #ifndef LOSCFG_MPU_MAX_ADDRESS 00561 #define LOSCFG_MPU_MAX_ADDRESS 0xFFFFFFFFUL // Maximum protected address 00562 #endif 00563 00564 /*============================================================================= 00565 Runstop module configuration 00566 =============================================================================*/ 00567 00568 /** 00569 * @ingroup los_config 00570 * Configuration item for runstop module tailoring 00571 */ 00572 #ifndef LOSCFG_KERNEL_RUNSTOP 00573 #define LOSCFG_KERNEL_RUNSTOP NO 00574 #endif 00575 00576 /*============================================================================= 00577 Perf module configuration 00578 =============================================================================*/ 00579 00580 /** 00581 * @ingroup los_config 00582 * Configuration item for performance moniter unit 00583 */ 00584 #ifndef OS_INCLUDE_PERF 00585 #define OS_INCLUDE_PERF NO 00586 #endif 00587 00588 00589 /*============================================================================= 00590 CPUP configuration 00591 =============================================================================*/ 00592 00593 /** 00594 * @ingroup los_config 00595 * Configuration item for CPU usage tailoring 00596 */ 00597 #ifndef LOSCFG_BASE_CORE_CPUP 00598 #define LOSCFG_BASE_CORE_CPUP NO 00599 #endif 00600 00601 00602 /*============================================================================= 00603 fw Interface configuration 00604 =============================================================================*/ 00605 00606 /** 00607 * @ingroup los_config 00608 * Configuration item for the monitoring of task communication 00609 */ 00610 #ifndef LOSCFG_COMPAT_CMSIS_FW 00611 #define LOSCFG_COMPAT_CMSIS_FW NO 00612 #endif 00613 00614 00615 /*============================================================================= 00616 Shell module configuration 00617 =============================================================================*/ 00618 00619 /** 00620 * @ingroup los_config 00621 * Configuration item for shell module tailoring 00622 */ 00623 #ifndef OS_INCLUDE_SHELL 00624 #define OS_INCLUDE_SHELL NO 00625 #endif 00626 00627 00628 /*============================================================================= 00629 Test module configuration 00630 =============================================================================*/ 00631 00632 /** 00633 * @ingroup los_config 00634 * Configuration test case to open 00635 */ 00636 #ifndef LOSCFG_TEST 00637 #define LOSCFG_TEST NO 00638 #endif 00639 00640 00641 /*============================================================================= 00642 LiteOS kernel version configuration 00643 =============================================================================*/ 00644 00645 /** 00646 * @ingroup los_config 00647 * Version number 00648 */ 00649 #ifndef LITEOS_VER 00650 #define LITEOS_VER "Huawei LiteOS Kernel V100R001c00B021" 00651 #endif 00652 00653 /** 00654 * @ingroup los_config 00655 * Configuration CMSIS_OS_VER 00656 */ 00657 #ifndef CMSIS_OS_VER 00658 #define CMSIS_OS_VER 1 00659 #endif 00660 00661 /*============================================================================= 00662 trace configuration 00663 =============================================================================*/ 00664 00665 /** 00666 * @ingroup los_config 00667 * Configuration liteos trace 00668 */ 00669 #ifndef LOSCFG_KERNEL_TRACE 00670 #define LOSCFG_KERNEL_TRACE NO 00671 #endif 00672 00673 00674 /*============================================================================= 00675 Declaration of Huawei LiteOS module initialization functions 00676 =============================================================================*/ 00677 00678 00679 /** 00680 * @ingroup los_config 00681 * @brief: Task init function. 00682 * 00683 * @par Description: 00684 * This API is used to initialize task module. 00685 * 00686 * @attention: 00687 * <ul><li>None.</li></ul> 00688 * 00689 * @param: None. 00690 * 00691 * @retval #LOS_ERRNO_TSK_NO_MEMORY 0x03000200:Insufficient memory for task creation. 00692 * @retval #LOS_OK 0:Task initialization success. 00693 * 00694 * @par Dependency: 00695 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00696 * @see None. 00697 * @since Huawei LiteOS V100R001C00 00698 */ 00699 extern UINT32 osTaskInit(VOID); 00700 00701 00702 /** 00703 * @ingroup los_config 00704 * @brief: hardware interrupt init function. 00705 * 00706 * @par Description: 00707 * This API is used to initialize hardware interrupt module. 00708 * 00709 * @attention: 00710 * <ul><li>None.</li></ul> 00711 * 00712 * @param: None. 00713 * 00714 * @retval #LOS_OK 0:Hardware interrupt initialization success. 00715 * 00716 * @par Dependency: 00717 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00718 * @see None. 00719 * @since Huawei LiteOS V100R001C00 00720 */ 00721 extern VOID osHwiInit(void); 00722 00723 00724 /** 00725 * @ingroup los_config 00726 * @brief: Semaphore init function. 00727 * 00728 * @par Description: 00729 * This API is used to initialize Semaphore module. 00730 * 00731 * @attention: 00732 * <ul><li>None.</li></ul> 00733 * 00734 * @param: None. 00735 * 00736 * @retval #LOS_ERRNO_SEM_NO_MEMORY 0x02000700:The memory is insufficient. 00737 * @retval #LOS_OK 0:Semaphore initialization success. 00738 * 00739 * @par Dependency: 00740 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00741 * @see None. 00742 * @since Huawei LiteOS V100R001C00 00743 */ 00744 extern UINT32 osSemInit(void); 00745 00746 00747 /** 00748 * @ingroup los_config 00749 * @brief: Mutex init function. 00750 * 00751 * @par Description: 00752 * This API is used to initialize mutex module. 00753 * 00754 * @attention: 00755 * <ul><li>None.</li></ul> 00756 * 00757 * @param: None. 00758 * 00759 * @retval #LOS_ERRNO_MUX_NO_MEMORY 0x02001d00:The memory request fails. 00760 * @retval #LOS_OK 0:Mutex initialization success. 00761 * 00762 * @par Dependency: 00763 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00764 * @see None. 00765 * @since Huawei LiteOS V100R001C00 00766 */ 00767 extern UINT32 osMuxInit(void); 00768 00769 00770 /** 00771 * @ingroup los_config 00772 * @brief: Queue init function. 00773 * 00774 * @par Description: 00775 * This API is used to initialize Queue module. 00776 * 00777 * @attention: 00778 * <ul><li>None.</li></ul> 00779 * 00780 * @param: None. 00781 * 00782 * @retval #LOS_ERRNO_QUEUE_MAXNUM_ZERO 0x02000600:The maximum number of queue resources is configured to 0. 00783 * @retval #LOS_ERRNO_QUEUE_NO_MEMORY 0x02000601:The queue block memory fails to be initialized. 00784 * @retval #LOS_OK 0:Queue initialization success. 00785 * 00786 * @par Dependency: 00787 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00788 * @see None. 00789 * @since Huawei LiteOS V100R001C00 00790 */ 00791 extern UINT32 osQueueInit(void); 00792 00793 00794 /** 00795 * @ingroup los_config 00796 * @brief: Software Timers init function. 00797 * 00798 * @par Description: 00799 * This API is used to initialize Software Timers module. 00800 * 00801 * @attention: 00802 * <ul><li>None.</li></ul> 00803 * 00804 * @param: None. 00805 * 00806 * @retval #LOS_ERRNO_SWTMR_MAXSIZE_INVALID 0x02000308:Invalid configured number of software timers. 00807 * @retval #LOS_ERRNO_SWTMR_NO_MEMORY 0x02000307:Insufficient memory for software timer linked list creation. 00808 * @retval #LOS_ERRNO_SWTMR_HANDLER_POOL_NO_MEM 0x0200030a:Insufficient memory allocated by membox. 00809 * @retval #LOS_ERRNO_SWTMR_QUEUE_CREATE_FAILED 0x0200030b:The software timer queue fails to be created. 00810 * @retval #LOS_ERRNO_SWTMR_TASK_CREATE_FAILED 0x0200030c:The software timer task fails to be created. 00811 * @retval #LOS_OK 0:Software Timers initialization success. 00812 * 00813 * @par Dependency: 00814 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00815 * @see None. 00816 * @since Huawei LiteOS V100R001C00 00817 */ 00818 extern UINT32 osSwTmrInit(void); 00819 00820 00821 /** 00822 * @ingroup los_config 00823 * @brief: Task start running function. 00824 * 00825 * @par Description: 00826 * This API is used to start a task. 00827 * 00828 * @attention: 00829 * <ul><li>None.</li></ul> 00830 * 00831 * @param: None. 00832 * 00833 * @retval None. 00834 * 00835 * @par Dependency: 00836 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00837 * @see None. 00838 * @since Huawei LiteOS V100R001C00 00839 */ 00840 extern VOID LOS_StartToRun(VOID); 00841 00842 00843 /** 00844 * @ingroup los_config 00845 * @brief: Test Task init function. 00846 * 00847 * @par Description: 00848 * This API is used to initialize Test Task. 00849 * 00850 * @attention: 00851 * <ul><li>None.</li></ul> 00852 * 00853 * @param: None. 00854 * 00855 * @retval #LOS_OK 0:App_Task initialization success. 00856 * 00857 * @par Dependency: 00858 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00859 * @see None. 00860 * @since Huawei LiteOS V100R001C00 00861 */ 00862 extern UINT32 los_TestInit(VOID); 00863 00864 00865 /** 00866 * @ingroup los_config 00867 * @brief: User application Task init function. 00868 * 00869 * @par Description: 00870 * This API is used to initialize User application Task module. 00871 * 00872 * @attention: 00873 * <ul><li>None.</li></ul> 00874 * 00875 * @param: None. 00876 * 00877 * @retval #LOS_OK 0:App_Task initialization success. 00878 * 00879 * @par Dependency: 00880 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00881 * @see None. 00882 * @since Huawei LiteOS V100R001C00 00883 */ 00884 //extern UINT32 osAppInit(VOID); 00885 00886 00887 /** 00888 * @ingroup los_config 00889 * @brief: Task start function. 00890 * 00891 * @par Description: 00892 * This API is used to start all tasks. 00893 * 00894 * @attention: 00895 * <ul><li>None.</li></ul> 00896 * 00897 * @param: None. 00898 * 00899 * @retval None. 00900 * 00901 * @par Dependency: 00902 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00903 * @see None. 00904 * @since Huawei LiteOS V100R001C00 00905 */ 00906 extern VOID osStart(void); 00907 00908 00909 /** 00910 * @ingroup los_config 00911 * @brief: Hardware init function. 00912 * 00913 * @par Description: 00914 * This API is used to initialize Hardware module. 00915 * 00916 * @attention: 00917 * <ul><li>None.</li></ul> 00918 * 00919 * @param: None. 00920 * 00921 * @retval None. 00922 * 00923 * @par Dependency: 00924 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00925 * @see None. 00926 * @since Huawei LiteOS V100R001C00 00927 */ 00928 extern VOID osHwInit(VOID); 00929 00930 00931 /** 00932 *@ingroup los_config 00933 *@brief Configure Tick Interrupt Start. 00934 * 00935 *@par Description: 00936 *This API is used to configure Tick Interrupt Start. 00937 * 00938 *@attention 00939 *<ul> 00940 *<li>None.</li> 00941 *</ul> 00942 * 00943 *@param: None. 00944 * 00945 *@retval #LOS_OK 0:configure Tick Interrupt success. 00946 *@retval #LOS_ERRNO_TICK_CFG_INVALID 0x02000400:configure Tick Interrupt failed. 00947 * 00948 *@par Dependency: 00949 *<ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00950 *@see 00951 *@since Huawei LiteOS V100R001C00 00952 */ 00953 extern UINT32 osTickStart(VOID); 00954 00955 00956 /** 00957 *@ingroup los_config 00958 *@brief Scheduling initialization. 00959 * 00960 *@par Description: 00961 *<ul> 00962 *<li>This API is used to initialize scheduling that is used for later task scheduling.</li> 00963 *</ul> 00964 *@attention 00965 *<ul> 00966 *<li>None.</li> 00967 *</ul> 00968 * 00969 *@param: None. 00970 * 00971 *@retval: None. 00972 *@par Dependency: 00973 *<ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00974 *@see 00975 *@since Huawei LiteOS V100R001C00 00976 */ 00977 extern VOID osTimesliceInit(VOID); 00978 00979 00980 /** 00981 * @ingroup los_config 00982 * @brief: System memory init function. 00983 * 00984 * @par Description: 00985 * This API is used to initialize system memory module. 00986 * 00987 * @attention: 00988 * <ul><li>None.</li></ul> 00989 * 00990 * @param: None. 00991 * 00992 * @retval #LOS_OK 0:System memory initialization success. 00993 * @retval #OS_ERROR (UINT32)(-1):System memory initialization failed. 00994 * 00995 * @par Dependency: 00996 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 00997 * @see None. 00998 * @since Huawei LiteOS V100R001C00 00999 */ 01000 extern LITE_OS_SEC_TEXT_INIT UINT32 osMemSystemInit(VOID); 01001 01002 01003 /** 01004 * @ingroup los_config 01005 * @brief: Task Monitor init function. 01006 * 01007 * @par Description: 01008 * This API is used to initialize Task Monitor module. 01009 * 01010 * @attention: 01011 * <ul><li>None.</li></ul> 01012 * 01013 * @param: None. 01014 * 01015 * @retval #LOS_OK 0:Task Monitor initialization success. 01016 * 01017 * @par Dependency: 01018 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 01019 * @see None. 01020 * @since Huawei LiteOS V100R001C00 01021 */ 01022 extern VOID osTaskMonInit(VOID); 01023 01024 01025 /** 01026 * @ingroup los_config 01027 * @brief: CPUP init function. 01028 * 01029 * @par Description: 01030 * This API is used to initialize CPUP module. 01031 * 01032 * @attention: 01033 * <ul><li>None.</li></ul> 01034 * 01035 * @param: None. 01036 * 01037 * @retval #LOS_ERRNO_CPUP_NO_MEMORY 0x02001e00:The request for memory fails. 01038 * @retval #LOS_OK 0:CPUP initialization success. 01039 * 01040 * @par Dependency: 01041 * <ul><li>los_config.h: the header file that contains the API declaration.</li></ul> 01042 * @see None. 01043 * @since Huawei LiteOS V100R001C00 01044 */ 01045 extern UINT32 osCpupInit(VOID); 01046 01047 01048 extern LITE_OS_SEC_TEXT_INIT UINT32 LOS_Start(void); 01049 01050 01051 extern LITE_OS_SEC_TEXT_INIT int main(void); 01052 01053 01054 #ifdef __cplusplus 01055 #if __cplusplus 01056 } 01057 #endif /* __cplusplus */ 01058 #endif /* __cplusplus */ 01059 01060 01061 #endif /* _LOS_CONFIG_H */