xref: /linux/tools/perf/util/perf-regs-arch/perf_regs_arm.c (revision 57390019b68b83f96eb98f490367b9df1f2d77cb)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #ifdef HAVE_PERF_REGS_SUPPORT
4 
5 #include "../perf_regs.h"
6 #include "../../../arch/arm/include/uapi/asm/perf_regs.h"
7 
8 const char *__perf_reg_name_arm(int id)
9 {
10 	switch (id) {
11 	case PERF_REG_ARM_R0:
12 		return "r0";
13 	case PERF_REG_ARM_R1:
14 		return "r1";
15 	case PERF_REG_ARM_R2:
16 		return "r2";
17 	case PERF_REG_ARM_R3:
18 		return "r3";
19 	case PERF_REG_ARM_R4:
20 		return "r4";
21 	case PERF_REG_ARM_R5:
22 		return "r5";
23 	case PERF_REG_ARM_R6:
24 		return "r6";
25 	case PERF_REG_ARM_R7:
26 		return "r7";
27 	case PERF_REG_ARM_R8:
28 		return "r8";
29 	case PERF_REG_ARM_R9:
30 		return "r9";
31 	case PERF_REG_ARM_R10:
32 		return "r10";
33 	case PERF_REG_ARM_FP:
34 		return "fp";
35 	case PERF_REG_ARM_IP:
36 		return "ip";
37 	case PERF_REG_ARM_SP:
38 		return "sp";
39 	case PERF_REG_ARM_LR:
40 		return "lr";
41 	case PERF_REG_ARM_PC:
42 		return "pc";
43 	default:
44 		return NULL;
45 	}
46 
47 	return NULL;
48 }
49 
50 uint64_t __perf_reg_ip_arm(void)
51 {
52 	return PERF_REG_ARM_PC;
53 }
54 
55 uint64_t __perf_reg_sp_arm(void)
56 {
57 	return PERF_REG_ARM_SP;
58 }
59 
60 #endif
61