Path: blob/master/tools/perf/arch/sh/util/dwarf-regs.c
10824 views
/*1* Mapping of DWARF debug register numbers into register names.2*3* Copyright (C) 2010 Matt Fleming <[email protected]>4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License16* along with this program; if not, write to the Free Software17* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.18*19*/2021#include <libio.h>22#include <dwarf-regs.h>2324/*25* Generic dwarf analysis helpers26*/2728#define SH_MAX_REGS 1829const char *sh_regs_table[SH_MAX_REGS] = {30"r0",31"r1",32"r2",33"r3",34"r4",35"r5",36"r6",37"r7",38"r8",39"r9",40"r10",41"r11",42"r12",43"r13",44"r14",45"r15",46"pc",47"pr",48};4950/* Return architecture dependent register string (for kprobe-tracer) */51const char *get_arch_regstr(unsigned int n)52{53return (n <= SH_MAX_REGS) ? sh_regs_table[n] : NULL;54}555657