1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2016 Chandan Kumar, IBM Corporation.
8 #include <asm/perf_regs.h>
9 #include "../../util/unwind.h"
10 #include "../../util/debug.h"
12 int libunwind__arch_reg_id(int regnum
)
16 return PERF_REG_POWERPC_R0
;
18 return PERF_REG_POWERPC_R1
;
20 return PERF_REG_POWERPC_R2
;
22 return PERF_REG_POWERPC_R3
;
24 return PERF_REG_POWERPC_R4
;
26 return PERF_REG_POWERPC_R5
;
28 return PERF_REG_POWERPC_R6
;
30 return PERF_REG_POWERPC_R7
;
32 return PERF_REG_POWERPC_R8
;
34 return PERF_REG_POWERPC_R9
;
36 return PERF_REG_POWERPC_R10
;
38 return PERF_REG_POWERPC_R11
;
40 return PERF_REG_POWERPC_R12
;
42 return PERF_REG_POWERPC_R13
;
44 return PERF_REG_POWERPC_R14
;
46 return PERF_REG_POWERPC_R15
;
48 return PERF_REG_POWERPC_R16
;
50 return PERF_REG_POWERPC_R17
;
52 return PERF_REG_POWERPC_R18
;
54 return PERF_REG_POWERPC_R19
;
56 return PERF_REG_POWERPC_R20
;
58 return PERF_REG_POWERPC_R21
;
60 return PERF_REG_POWERPC_R22
;
62 return PERF_REG_POWERPC_R23
;
64 return PERF_REG_POWERPC_R24
;
66 return PERF_REG_POWERPC_R25
;
68 return PERF_REG_POWERPC_R26
;
70 return PERF_REG_POWERPC_R27
;
72 return PERF_REG_POWERPC_R28
;
74 return PERF_REG_POWERPC_R29
;
76 return PERF_REG_POWERPC_R30
;
78 return PERF_REG_POWERPC_R31
;
80 return PERF_REG_POWERPC_LINK
;
82 return PERF_REG_POWERPC_CTR
;
84 return PERF_REG_POWERPC_XER
;
86 return PERF_REG_POWERPC_NIP
;
88 pr_err("unwind: invalid reg id %d\n", regnum
);