154568cb3Sopenharmony_ci/*
254568cb3Sopenharmony_ci * Copyright (c) 2009-2022 Huawei Technologies Co., Ltd. All rights reserved.
354568cb3Sopenharmony_ci *
454568cb3Sopenharmony_ci * UniProton is licensed under Mulan PSL v2.
554568cb3Sopenharmony_ci * You can use this software according to the terms and conditions of the Mulan PSL v2.
654568cb3Sopenharmony_ci * You may obtain a copy of Mulan PSL v2 at:
754568cb3Sopenharmony_ci *          http://license.coscl.org.cn/MulanPSL2
854568cb3Sopenharmony_ci * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
954568cb3Sopenharmony_ci * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
1054568cb3Sopenharmony_ci * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
1154568cb3Sopenharmony_ci * See the Mulan PSL v2 for more details.
1254568cb3Sopenharmony_ci * Create: 2009-12-22
1354568cb3Sopenharmony_ci * Description: CPU占用率模块的C文件
1454568cb3Sopenharmony_ci */
1554568cb3Sopenharmony_ci#ifndef PRT_CPUP_INTERNAL_H
1654568cb3Sopenharmony_ci#define PRT_CPUP_INTERNAL_H
1754568cb3Sopenharmony_ci
1854568cb3Sopenharmony_ci#include "prt_lib_external.h"
1954568cb3Sopenharmony_ci#include "prt_err_external.h"
2054568cb3Sopenharmony_ci#include "prt_sys_external.h"
2154568cb3Sopenharmony_ci#include "prt_cpu_external.h"
2254568cb3Sopenharmony_ci#include "prt_cpup_external.h"
2354568cb3Sopenharmony_ci#include "prt_mem_external.h"
2454568cb3Sopenharmony_ci#include "prt_sys_external.h"
2554568cb3Sopenharmony_ci#include "prt_task_external.h"
2654568cb3Sopenharmony_ci#include "prt_hook_external.h"
2754568cb3Sopenharmony_ci
2854568cb3Sopenharmony_ci/*
2954568cb3Sopenharmony_ci * 模块内宏定义
3054568cb3Sopenharmony_ci */
3154568cb3Sopenharmony_ciextern U32 *g_cpupInstant;
3254568cb3Sopenharmony_ciextern U32 g_ticksPerSample;
3354568cb3Sopenharmony_ciextern U32 g_cpupIndex;
3454568cb3Sopenharmony_ciextern U32 g_tickCount;
3554568cb3Sopenharmony_ciextern U64 g_baseValue;
3654568cb3Sopenharmony_ciextern CpupNowFunc g_cpupNow;
3754568cb3Sopenharmony_ci/* CPUP告警检测函数钩子 */
3854568cb3Sopenharmony_ciextern CpupWarnFunc g_cpupWarnCheck;
3954568cb3Sopenharmony_ci
4054568cb3Sopenharmony_ci/*
4154568cb3Sopenharmony_ci * 模块内函数声明
4254568cb3Sopenharmony_ci */
4354568cb3Sopenharmony_ciextern U32 OsCpupReg(struct CpupModInfo *modInfo);
4454568cb3Sopenharmony_ciextern U32 OsCpupWarnReg(struct CpupModInfo *modInfo);
4554568cb3Sopenharmony_ciextern U32 OsCpupInit(void);
4654568cb3Sopenharmony_ci/* 放在tick任务中 */
4754568cb3Sopenharmony_ciextern void OsCpupWarn(void);
4854568cb3Sopenharmony_ci
4954568cb3Sopenharmony_ciextern U32 OsCpupGet(void);
5054568cb3Sopenharmony_ci
5154568cb3Sopenharmony_ciOS_SEC_ALW_INLINE INLINE void OsMcCpupSet(U32 coreId, U32 cpupValue)
5254568cb3Sopenharmony_ci{
5354568cb3Sopenharmony_ci    (void)coreId;
5454568cb3Sopenharmony_ci    (void)cpupValue;
5554568cb3Sopenharmony_ci}
5654568cb3Sopenharmony_ci
5754568cb3Sopenharmony_ci#endif /* PRT_CPUP_INTERNAL_H */
58