]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | // SPDX-License-Identifier: GPL-2.0 |
f602be63 HC |
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 | ||
861e10be | 10 | #include <stddef.h> |
f602be63 HC |
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 | } |