1 #ifndef ARCH_PERF_REGS_H
2 #define ARCH_PERF_REGS_H
3 
4 #include <stdlib.h>
5 #include <linux/types.h>
6 #include <asm/perf_regs.h>
7 
8 void perf_regs_load(u64 *regs);
9 
10 #define PERF_REGS_MASK	((1ULL << PERF_REG_ARM_MAX) - 1)
11 #define PERF_REGS_MAX	PERF_REG_ARM_MAX
12 #define PERF_SAMPLE_REGS_ABI	PERF_SAMPLE_REGS_ABI_32
13 
14 #define PERF_REG_IP	PERF_REG_ARM_PC
15 #define PERF_REG_SP	PERF_REG_ARM_SP
16 
17 static inline const char *perf_reg_name(int id)
18 {
19 	switch (id) {
20 	case PERF_REG_ARM_R0:
21 		return "r0";
22 	case PERF_REG_ARM_R1:
23 		return "r1";
24 	case PERF_REG_ARM_R2:
25 		return "r2";
26 	case PERF_REG_ARM_R3:
27 		return "r3";
28 	case PERF_REG_ARM_R4:
29 		return "r4";
30 	case PERF_REG_ARM_R5:
31 		return "r5";
32 	case PERF_REG_ARM_R6:
33 		return "r6";
34 	case PERF_REG_ARM_R7:
35 		return "r7";
36 	case PERF_REG_ARM_R8:
37 		return "r8";
38 	case PERF_REG_ARM_R9:
39 		return "r9";
40 	case PERF_REG_ARM_R10:
41 		return "r10";
42 	case PERF_REG_ARM_FP:
43 		return "fp";
44 	case PERF_REG_ARM_IP:
45 		return "ip";
46 	case PERF_REG_ARM_SP:
47 		return "sp";
48 	case PERF_REG_ARM_LR:
49 		return "lr";
50 	case PERF_REG_ARM_PC:
51 		return "pc";
52 	default:
53 		return NULL;
54 	}
55 
56 	return NULL;
57 }
58 
59 #endif /* ARCH_PERF_REGS_H */
60