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