Linux-libre 4.14.68-gnu
[librecmc/linux-libre.git] / tools / perf / arch / s390 / util / dwarf-regs.c
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Mapping of DWARF debug register numbers into register names.
4  *
5  *    Copyright IBM Corp. 2010
6  *    Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>,
7  *
8  */
9
10 #include <stddef.h>
11 #include <dwarf-regs.h>
12
13 #define NUM_GPRS 16
14
15 static const char *gpr_names[NUM_GPRS] = {
16         "%r0", "%r1",  "%r2",  "%r3",  "%r4",  "%r5",  "%r6",  "%r7",
17         "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15",
18 };
19
20 const char *get_arch_regstr(unsigned int n)
21 {
22         return (n >= NUM_GPRS) ? NULL : gpr_names[n];
23 }