• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: ARCH cpu trace interface for project
15  *
16  * Create:  2021-10-25
17  */
18 #ifndef ARCH_TRACE_H
19 #define ARCH_TRACE_H
20 
21 #include <stdint.h>
22 #include "platform_core.h"
23 #ifdef SUPPORT_CPU_TRACE
24 #include "cpu_trace.h"
25 #endif
26 #ifdef __cplusplus
27 #if __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30 #endif /* __cplusplus */
31 
32 #define  RISCV_TRACE_MEM_REGION_START   TRACE_MEM_REGION_START
33 #define  RISCV_TRACE_MEM_REGION_LENGTH  TRACE_MEM_REGION_LENGTH
34 
35 #ifdef SUPPORT_CPU_TRACE
36 typedef cpu_trace_item_t  riscv_cpu_trace_item_t;
37 #endif
38 
39 /**
40  * @brief  Disable cpu trace for riscv.
41  */
riscv_cpu_trace_disable(void)42 static inline void riscv_cpu_trace_disable(void)
43 {
44 #ifdef SUPPORT_CPU_TRACE
45     cpu_trace_disable();
46 #endif
47 }
48 
49 #ifdef __cplusplus
50 #if __cplusplus
51 }
52 #endif /* __cplusplus */
53 #endif /* __cplusplus */
54 
55 #endif
56