1 /*
2  * Copyright (c) 2009-2022 Huawei Technologies Co., Ltd. All rights reserved.
3  *
4  * UniProton is licensed under Mulan PSL v2.
5  * You can use this software according to the terms and conditions of the Mulan PSL v2.
6  * You may obtain a copy of Mulan PSL v2 at:
7  *          http://license.coscl.org.cn/MulanPSL2
8  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
9  * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
10  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
11  * See the Mulan PSL v2 for more details.
12  * Create: 2009-12-22
13  * Description: hw模块内部头文件。
14  */
15 #ifndef PRT_HW_TICK_INTERNAL_H
16 #define PRT_HW_TICK_INTERNAL_H
17 
18 #include "prt_lib_external.h"
19 #include "prt_sys_external.h"
20 #include "prt_tick_external.h"
21 
22 /* 系统当前运行的时间,单位cycle */
23 extern U64 g_cycleNow;
24 /* 在tick中记录的系统当前cycle值 */
25 extern U64 g_cycleInTick;
26 /* 系统当前运行的时间,时间是g_cyclePerTick的整数倍 */
27 extern U64 g_cycleByTickNow;
28 
29 /*
30  * 模块内宏定义
31  */
32 #define OS_SYSTICK_CONTROL_COUNTFLAG_MSK (1U << 16)
33 #define OS_SYSTICK_CONTROL_REG 0xE000E010
34 #define OS_SYSTICK_RELOAD_REG 0xE000E014
35 #define OS_SYSTICK_CURRENT_REG 0xE000E018
36 
37 /*
38  * 模块间函数声明
39  */
40 extern void OsCycleUpdate(void);
41 
42 #endif /* PRT_HW_TICK_INTERNAL_H */
43