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: CPU占用率模块的C文件 14 */ 15 #ifndef PRT_CPUP_INTERNAL_H 16 #define PRT_CPUP_INTERNAL_H 17 18 #include "prt_lib_external.h" 19 #include "prt_err_external.h" 20 #include "prt_sys_external.h" 21 #include "prt_cpu_external.h" 22 #include "prt_cpup_external.h" 23 #include "prt_mem_external.h" 24 #include "prt_sys_external.h" 25 #include "prt_task_external.h" 26 #include "prt_hook_external.h" 27 28 /* 29 * 模块内宏定义 30 */ 31 extern U32 *g_cpupInstant; 32 extern U32 g_ticksPerSample; 33 extern U32 g_cpupIndex; 34 extern U32 g_tickCount; 35 extern U64 g_baseValue; 36 extern CpupNowFunc g_cpupNow; 37 /* CPUP告警检测函数钩子 */ 38 extern CpupWarnFunc g_cpupWarnCheck; 39 40 /* 41 * 模块内函数声明 42 */ 43 extern U32 OsCpupReg(struct CpupModInfo *modInfo); 44 extern U32 OsCpupWarnReg(struct CpupModInfo *modInfo); 45 extern U32 OsCpupInit(void); 46 /* 放在tick任务中 */ 47 extern void OsCpupWarn(void); 48 49 extern U32 OsCpupGet(void); 50 OsMcCpupSet(U32 coreId,U32 cpupValue)51OS_SEC_ALW_INLINE INLINE void OsMcCpupSet(U32 coreId, U32 cpupValue) 52 { 53 (void)coreId; 54 (void)cpupValue; 55 } 56 57 #endif /* PRT_CPUP_INTERNAL_H */ 58