xref: /linux/tools/perf/arch/riscv/include/perf_regs.h (revision bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2019 Hangzhou C-SKY Microsystems co.,ltd. */
3 
4 #ifndef ARCH_PERF_REGS_H
5 #define ARCH_PERF_REGS_H
6 
7 #include <stdlib.h>
8 #include <linux/types.h>
9 #include "../../../../arch/riscv/include/uapi/asm/perf_regs.h"
10 
11 #define PERF_REGS_MASK	((1ULL << PERF_REG_RISCV_MAX) - 1)
12 #define PERF_REGS_MAX	PERF_REG_RISCV_MAX
13 
14 #if defined(__riscv_xlen)
15 #if __riscv_xlen == 64
16 #define PERF_SAMPLE_REGS_ABI	PERF_SAMPLE_REGS_ABI_64
17 #else
18 #define PERF_SAMPLE_REGS_ABI	PERF_SAMPLE_REGS_ABI_32
19 #endif
20 #else
21 #define PERF_SAMPLE_REGS_ABI	PERF_SAMPLE_REGS_NONE
22 #endif
23 
24 #endif /* ARCH_PERF_REGS_H */
25