2 * Copyright 2016 Chandan Kumar, IBM Corporation.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
11 #include <libunwind.h>
12 #include <asm/perf_regs.h>
13 #include "../../util/unwind.h"
14 #include "../../util/debug.h"
16 int libunwind__arch_reg_id(int regnum
)
20 return PERF_REG_POWERPC_R0
;
22 return PERF_REG_POWERPC_R1
;
24 return PERF_REG_POWERPC_R2
;
26 return PERF_REG_POWERPC_R3
;
28 return PERF_REG_POWERPC_R4
;
30 return PERF_REG_POWERPC_R5
;
32 return PERF_REG_POWERPC_R6
;
34 return PERF_REG_POWERPC_R7
;
36 return PERF_REG_POWERPC_R8
;
38 return PERF_REG_POWERPC_R9
;
40 return PERF_REG_POWERPC_R10
;
42 return PERF_REG_POWERPC_R11
;
44 return PERF_REG_POWERPC_R12
;
46 return PERF_REG_POWERPC_R13
;
48 return PERF_REG_POWERPC_R14
;
50 return PERF_REG_POWERPC_R15
;
52 return PERF_REG_POWERPC_R16
;
54 return PERF_REG_POWERPC_R17
;
56 return PERF_REG_POWERPC_R18
;
58 return PERF_REG_POWERPC_R19
;
60 return PERF_REG_POWERPC_R20
;
62 return PERF_REG_POWERPC_R21
;
64 return PERF_REG_POWERPC_R22
;
66 return PERF_REG_POWERPC_R23
;
68 return PERF_REG_POWERPC_R24
;
70 return PERF_REG_POWERPC_R25
;
72 return PERF_REG_POWERPC_R26
;
74 return PERF_REG_POWERPC_R27
;
76 return PERF_REG_POWERPC_R28
;
78 return PERF_REG_POWERPC_R29
;
80 return PERF_REG_POWERPC_R30
;
82 return PERF_REG_POWERPC_R31
;
84 return PERF_REG_POWERPC_LINK
;
86 return PERF_REG_POWERPC_CTR
;
88 return PERF_REG_POWERPC_XER
;
90 return PERF_REG_POWERPC_NIP
;
92 pr_err("unwind: invalid reg id %d\n", regnum
);