xref: /linux/tools/perf/util/dwarf-regs-arch/dwarf-regs-mips.c (revision c7decec2f2d2ab0366567f9e30c0e1418cece43f)
1*406b51a9SIan Rogers // SPDX-License-Identifier: GPL-2.0
2*406b51a9SIan Rogers #include <errno.h>
3*406b51a9SIan Rogers #include <dwarf-regs.h>
4*406b51a9SIan Rogers #include "../../../arch/mips/include/uapi/asm/perf_regs.h"
5*406b51a9SIan Rogers 
__get_dwarf_regnum_for_perf_regnum_mips(int perf_regnum)6*406b51a9SIan Rogers int __get_dwarf_regnum_for_perf_regnum_mips(int perf_regnum)
7*406b51a9SIan Rogers {
8*406b51a9SIan Rogers 	if (perf_regnum == PERF_REG_MIPS_PC)
9*406b51a9SIan Rogers 		return 37;
10*406b51a9SIan Rogers 	if (perf_regnum < 0 || perf_regnum >= PERF_REG_MIPS_MAX)
11*406b51a9SIan Rogers 		return -ENOENT;
12*406b51a9SIan Rogers 
13*406b51a9SIan Rogers 	return perf_regnum;
14*406b51a9SIan Rogers }
15