1 /* 2 * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. 3 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without modification, 6 * are permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, this list of 9 * conditions and the following disclaimer. 10 * 11 * 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 * of conditions and the following disclaimer in the documentation and/or other materials 13 * provided with the distribution. 14 * 15 * 3. Neither the name of the copyright holder nor the names of its contributors may be used 16 * to endorse or promote products derived from this software without specific prior written 17 * permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 #ifndef _TARGET_CONFIG_H 33 #define _TARGET_CONFIG_H 34 35 #include <stdint.h> 36 #include "wm_regs.h" 37 38 #ifdef __cplusplus 39 #if __cplusplus 40 extern "C" { 41 #endif /* __cplusplus */ 42 #endif /* __cplusplus */ 43 44 /* ============================================================================= 45 System clock module configuration 46 ============================================================================= */ 47 #define OS_SYS_CLOCK 80000000 48 #define LOSCFG_BASE_CORE_TICK_PER_SECOND (500UL) 49 #define LOSCFG_BASE_CORE_TICK_HW_TIME 0 50 #define LOSCFG_BASE_CORE_TICK_WTIMER 0 51 #define LOSCFG_BASE_CORE_TICK_RESPONSE_MAX (20000) 52 53 /* ============================================================================= 54 Hardware interrupt module configuration 55 ============================================================================= */ 56 #define LOSCFG_PLATFORM_HWI 1 57 #define LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT 1 58 #define LOSCFG_PLATFORM_HWI_LIMIT 32 59 /* ============================================================================= 60 Task module configuration 61 ============================================================================= */ 62 #define LOSCFG_BASE_CORE_TSK_LIMIT 31 63 #define LOSCFG_BASE_CORE_TSK_IDLE_STACK_SIZE (0x1000U) 64 #define LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE (0x800U) 65 #define LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE (0x200U) 66 #define LOSCFG_BASE_CORE_TIMESLICE 1 67 #define LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT 1000 68 #define LOSCFG_BASE_CORE_TSK_MONITOR 1 69 #define LOSCFG_EXC_HARDWARE_STACK_PROTECTION 0 70 /* ============================================================================= 71 Semaphore module configuration 72 ============================================================================= */ 73 #define LOSCFG_BASE_IPC_SEM 1 74 #define LOSCFG_BASE_IPC_SEM_LIMIT 64 75 /* ============================================================================= 76 Mutex module configuration 77 ============================================================================= */ 78 #define LOSCFG_BASE_IPC_MUX 1 79 #define LOSCFG_BASE_IPC_MUX_LIMIT 64 80 /* ============================================================================= 81 Queue module configuration 82 ============================================================================= */ 83 #define LOSCFG_BASE_IPC_QUEUE 1 84 #define LOSCFG_BASE_IPC_QUEUE_LIMIT 64 85 /* ============================================================================= 86 Software timer module configuration 87 ============================================================================= */ 88 #define LOSCFG_BASE_CORE_SWTMR 1 89 #define LOSCFG_BASE_CORE_SWTMR_ALIGN 0 90 #define LOSCFG_BASE_CORE_SWTMR_LIMIT 64 91 /* ============================================================================= 92 Exception module configuration 93 ============================================================================= */ 94 #define LOSCFG_PLATFORM_EXC 0 95 /* ============================================================================= 96 Memory module configuration 97 ============================================================================= */ 98 extern unsigned int __heap_start; 99 extern unsigned int __heap_end; 100 #define LOSCFG_SYS_EXTERNAL_HEAP 1 101 #define LOSCFG_SYS_HEAP_ADDR (void *)(UINTPTR)(&__heap_start) 102 #define LOSCFG_SYS_HEAP_SIZE ((UINTPTR)(&__heap_end) - (UINTPTR)(&__heap_start)) 103 #define LOSCFG_MEM_MUL_POOL 1 104 #define OS_SYS_MEM_NUM 20 105 #define LOSCFG_MEM_FREE_BY_TASKID 0 106 #define LOSCFG_BASE_MEM_NODE_INTEGRITY_CHECK 0 107 #define LOSCFG_STACK_POINT_ALIGN_SIZE 4 108 /* ============================================================================= 109 Exception module configuration 110 ============================================================================= */ 111 #define LOSCFG_KERNEL_PRINTF 1 112 113 #define LOSCFG_SUPPORT_LITTLEFS 1 114 115 #define PendSV_IRQn 22 // Pend SV Interrupt 116 117 extern void Reset_Handler(void); 118 extern void tspend_handler(void); 119 120 #ifdef __cplusplus 121 #if __cplusplus 122 } 123 #endif /* __cplusplus */ 124 #endif /* __cplusplus */ 125 126 #endif /* _TARGET_CONFIG_H */