Merge tag 'powerpc-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux/fpc-iii.git] / tools / perf / arch / sh / util / dwarf-regs.c
blob4b17fc86c73bd47180a890eec4e1c3b4f2adc2ef
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Mapping of DWARF debug register numbers into register names.
5 * Copyright (C) 2010 Matt Fleming <matt@console-pimps.org>
6 */
8 #include <stddef.h>
9 #include <dwarf-regs.h>
12 * Generic dwarf analysis helpers
15 #define SH_MAX_REGS 18
16 const char *sh_regs_table[SH_MAX_REGS] = {
17 "r0",
18 "r1",
19 "r2",
20 "r3",
21 "r4",
22 "r5",
23 "r6",
24 "r7",
25 "r8",
26 "r9",
27 "r10",
28 "r11",
29 "r12",
30 "r13",
31 "r14",
32 "r15",
33 "pc",
34 "pr",
37 /* Return architecture dependent register string (for kprobe-tracer) */
38 const char *get_arch_regstr(unsigned int n)
40 return (n < SH_MAX_REGS) ? sh_regs_table[n] : NULL;