1 // SPDX-License-Identifier: GPL-2.0
2 
3 #ifdef HAVE_PERF_REGS_SUPPORT
4 
5 #include "../perf_regs.h"
6 #include "../../../arch/s390/include/uapi/asm/perf_regs.h"
7 
__perf_reg_name_s390(int id)8 const char *__perf_reg_name_s390(int id)
9 {
10 	switch (id) {
11 	case PERF_REG_S390_R0:
12 		return "R0";
13 	case PERF_REG_S390_R1:
14 		return "R1";
15 	case PERF_REG_S390_R2:
16 		return "R2";
17 	case PERF_REG_S390_R3:
18 		return "R3";
19 	case PERF_REG_S390_R4:
20 		return "R4";
21 	case PERF_REG_S390_R5:
22 		return "R5";
23 	case PERF_REG_S390_R6:
24 		return "R6";
25 	case PERF_REG_S390_R7:
26 		return "R7";
27 	case PERF_REG_S390_R8:
28 		return "R8";
29 	case PERF_REG_S390_R9:
30 		return "R9";
31 	case PERF_REG_S390_R10:
32 		return "R10";
33 	case PERF_REG_S390_R11:
34 		return "R11";
35 	case PERF_REG_S390_R12:
36 		return "R12";
37 	case PERF_REG_S390_R13:
38 		return "R13";
39 	case PERF_REG_S390_R14:
40 		return "R14";
41 	case PERF_REG_S390_R15:
42 		return "R15";
43 	case PERF_REG_S390_FP0:
44 		return "FP0";
45 	case PERF_REG_S390_FP1:
46 		return "FP1";
47 	case PERF_REG_S390_FP2:
48 		return "FP2";
49 	case PERF_REG_S390_FP3:
50 		return "FP3";
51 	case PERF_REG_S390_FP4:
52 		return "FP4";
53 	case PERF_REG_S390_FP5:
54 		return "FP5";
55 	case PERF_REG_S390_FP6:
56 		return "FP6";
57 	case PERF_REG_S390_FP7:
58 		return "FP7";
59 	case PERF_REG_S390_FP8:
60 		return "FP8";
61 	case PERF_REG_S390_FP9:
62 		return "FP9";
63 	case PERF_REG_S390_FP10:
64 		return "FP10";
65 	case PERF_REG_S390_FP11:
66 		return "FP11";
67 	case PERF_REG_S390_FP12:
68 		return "FP12";
69 	case PERF_REG_S390_FP13:
70 		return "FP13";
71 	case PERF_REG_S390_FP14:
72 		return "FP14";
73 	case PERF_REG_S390_FP15:
74 		return "FP15";
75 	case PERF_REG_S390_MASK:
76 		return "MASK";
77 	case PERF_REG_S390_PC:
78 		return "PC";
79 	default:
80 		return NULL;
81 	}
82 
83 	return NULL;
84 }
85 
__perf_reg_ip_s390(void)86 uint64_t __perf_reg_ip_s390(void)
87 {
88 	return PERF_REG_S390_PC;
89 }
90 
__perf_reg_sp_s390(void)91 uint64_t __perf_reg_sp_s390(void)
92 {
93 	return PERF_REG_S390_R15;
94 }
95 
96 #endif
97