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