1 /* 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 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 * Description: mips 15 */ 16 17 #ifndef MIPS_H 18 #define MIPS_H 19 20 #include <stdint.h> 21 #include <stdbool.h> 22 /* get host thread run status */ 23 bool global_thread_status_get(void); 24 25 /* update host thread run status */ 26 void global_thread_status_update(bool status); 27 28 /* controller isr run time update when btc int out */ 29 void global_isr_time_statistics_update(uint64_t sys_time_start, uint64_t sys_time_end); 30 31 /* get controller isr run times */ 32 uint64_t global_isr_time_statistics_get(void); 33 34 /** 35 * @defgroup LIBS_MIPS MIPS Lib 36 * @ingroup LIBS 37 * @{ 38 */ 39 /* start calculating mips */ 40 void mips_compute_run_time_start(void); 41 42 /* stop calcualting mips */ 43 void mips_compute_run_time_stop(void); 44 45 /* register mips callback function. */ 46 void mips_init(void); 47 48 /* get bt thread status when compute mips */ 49 bool mips_get_bt_thread_status(void); 50 51 /* set bt thread status when compute mips */ 52 void mips_set_bt_thread_status(bool status); 53 54 /* get bt isr status when compute mips */ 55 bool mips_get_bt_isr_status(void); 56 57 /* set bt isr status when compute mips */ 58 void mips_set_bt_isr_status(bool status); 59 60 /* get platfrom isr run time while bt thread and bt isr running */ 61 uint32_t mips_get_plt_isr_run_time(void); 62 63 /* clear plt isr run time data */ 64 void mips_clear_plt_isr_run_time(void); 65 66 /** 67 * @} 68 */ 69 #endif 70