1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**@defgroup los_config System configuration items
17  * @ingroup kernel
18  */
19 
20 #ifndef _TARGET_CONFIG_H
21 #define _TARGET_CONFIG_H
22 
23 #include "stdint.h"
24 #include "stdbool.h"
25 #include "soc.h"
26 #include "los_compiler.h"
27 
28 #ifdef __cplusplus
29 #if __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32 #endif /* __cplusplus */
33 
34 /*=============================================================================
35                                         System clock module configuration
36 =============================================================================*/
37 #define OS_SYS_CLOCK                                        10000000UL
38 #define LOSCFG_BASE_CORE_TICK_PER_SECOND                    (100UL)
39 #define LOSCFG_BASE_CORE_TICK_HW_TIME                       0
40 #define LOSCFG_BASE_CORE_TICK_WTIMER                        1
41 #define LOSCFG_BASE_CORE_TICK_RESPONSE_MAX                  ((UINT64)-1)
42 
43 /*=============================================================================
44                                        Task module configuration
45 =============================================================================*/
46 #define LOSCFG_BASE_CORE_TSK_LIMIT                          24
47 #define LOSCFG_BASE_CORE_TSK_IDLE_STACK_SIZE                (0x500U)
48 #define LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE             (0x1000U)
49 #define LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE                 (0x500U)
50 #define LOSCFG_BASE_CORE_TIMESLICE                          1
51 #define LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT                  20000
52 #define LOSCFG_BASE_CORE_TSK_MONITOR                        1
53 
54 /*=============================================================================
55                                        Semaphore module configuration
56 =============================================================================*/
57 #define LOSCFG_BASE_IPC_SEM                                 1
58 #define LOSCFG_BASE_IPC_SEM_LIMIT                           48
59 /*=============================================================================
60                                        Mutex module configuration
61 =============================================================================*/
62 #define LOSCFG_BASE_IPC_MUX                                 1
63 #define LOSCFG_BASE_IPC_MUX_LIMIT                           50
64 /*=============================================================================
65                                        Queue module configuration
66 =============================================================================*/
67 #define LOSCFG_BASE_IPC_QUEUE                               1
68 #define LOSCFG_BASE_IPC_QUEUE_LIMIT                         24
69 /*=============================================================================
70                                        Software timer module configuration
71 =============================================================================*/
72 #define LOSCFG_BASE_CORE_SWTMR                              1
73 #define LOSCFG_BASE_CORE_SWTMR_ALIGN                        1
74 #define LOSCFG_BASE_CORE_SWTMR_LIMIT                        48
75 /*=============================================================================
76                                        Memory module configuration
77 =============================================================================*/
78 extern UINTPTR __heap_start;
79 extern UINTPTR __heap_size;
80 #define LOSCFG_SYS_EXTERNAL_HEAP                            1
81 #define LOSCFG_SYS_HEAP_ADDR                                (VOID *)&__heap_start
82 #define LOSCFG_SYS_HEAP_SIZE                                (UINTPTR)&__heap_size
83 #define LOSCFG_BASE_MEM_NODE_SIZE_CHECK                     0
84 #define LOSCFG_MEM_MUL_POOL                                 1
85 #define OS_SYS_MEM_NUM                                      20
86 #define LOSCFG_KERNEL_MEM_SLAB                              0
87 #define LOSCFG_MEMORY_BESTFIT                               1
88 /*=============================================================================
89                                         Exception module configuration
90 =============================================================================*/
91 #define LOSCFG_PLATFORM_HWI_WITH_ARG                        1
92 
93 #define LOSCFG_KERNEL_PRINTF                                1
94 
95 #define LOS_KERNEL_TEST_NOT_SMOKE                           0
96 #define LOS_KERNEL_HWI_TEST                                 0
97 /*=============================================================================
98                                        shell module configuration
99 =============================================================================*/
100 #define LOSCFG_USE_SHELL                                    1
101 #define LOSCFG_SHELL_PRIO                                   3
102 
103 extern UINT32 QemuCLZ(UINT32);
104 #undef CLZ
105 #define CLZ(n) QemuCLZ(n)
106 #ifdef __cplusplus
107 #if __cplusplus
108 }
109 #endif /* __cplusplus */
110 #endif /* __cplusplus */
111 
112 
113 #endif /* _TARGET_CONFIG_H */
114