summaryrefslogtreecommitdiffstats
path: root/tools/perf/arch/csky/util/dwarf-regs.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2024-11-09 00:45:55 +0100
committerNamhyung Kim <namhyung@kernel.org>2024-11-09 17:39:13 +0100
commitd4a0c4f22121f4ec635c726727a0d1a9f5f9a7af (patch)
treec1ed121e5d5c8ac46e322a62452864a59eb02052 /tools/perf/arch/csky/util/dwarf-regs.c
parentperf arm: Remove dwarf-regs.c (diff)
downloadlinux-d4a0c4f22121f4ec635c726727a0d1a9f5f9a7af.tar.xz
linux-d4a0c4f22121f4ec635c726727a0d1a9f5f9a7af.zip
perf dwarf-regs: Move csky dwarf-regs out of arch
Move arch/csky/util/dwarf-regs.c to util/dwarf-regs-csky.c and compile in unconditionally. To avoid get_arch_regstr being duplicated, rename to get_csky_regstr and add to get_dwarf_regstr switch. Update #ifdefs to allow ABI V1 and V2 tables at the same time. Determine the table from the ELF flags. Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Ian Rogers <irogers@google.com> Cc: Anup Patel <anup@brainfault.org> Cc: Yang Jihong <yangjihong@bytedance.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: David S. Miller <davem@davemloft.net> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Shenlin Liang <liangshenlin@eswincomputing.com> Cc: Nick Terrell <terrelln@fb.com> Cc: Guilherme Amadio <amadio@gentoo.org> Cc: Steinar H. Gunderson <sesse@google.com> Cc: Changbin Du <changbin.du@huawei.com> Cc: Alexander Lobakin <aleksander.lobakin@intel.com> Cc: Przemek Kitszel <przemyslaw.kitszel@intel.com> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Guo Ren <guoren@kernel.org> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Will Deacon <will@kernel.org> Cc: James Clark <james.clark@linaro.org> Cc: Mike Leach <mike.leach@linaro.org> Cc: Chen Pei <cp0613@linux.alibaba.com> Cc: Leo Yan <leo.yan@linux.dev> Cc: Oliver Upton <oliver.upton@linux.dev> Cc: Aditya Gupta <adityag@linux.ibm.com> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-riscv@lists.infradead.org Cc: Bibo Mao <maobibo@loongson.cn> Cc: John Garry <john.g.garry@oracle.com> Cc: Atish Patra <atishp@rivosinc.com> Cc: Dima Kogan <dima@secretsauce.net> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Dr. David Alan Gilbert <linux@treblig.org> Cc: linux-csky@vger.kernel.org Link: https://lore.kernel.org/r/20241108234606.429459-11-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/arch/csky/util/dwarf-regs.c')
-rw-r--r--tools/perf/arch/csky/util/dwarf-regs.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/tools/perf/arch/csky/util/dwarf-regs.c b/tools/perf/arch/csky/util/dwarf-regs.c
deleted file mode 100644
index ca86ecaeacbb..000000000000
--- a/tools/perf/arch/csky/util/dwarf-regs.c
+++ /dev/null
@@ -1,49 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-// Copyright (C) 2019 Hangzhou C-SKY Microsystems co.,ltd.
-// Mapping of DWARF debug register numbers into register names.
-
-#include <stddef.h>
-#include <dwarf-regs.h>
-
-#if defined(__CSKYABIV2__)
-#define CSKY_MAX_REGS 73
-const char *csky_dwarf_regs_table[CSKY_MAX_REGS] = {
- /* r0 ~ r8 */
- "%a0", "%a1", "%a2", "%a3", "%regs0", "%regs1", "%regs2", "%regs3",
- /* r9 ~ r15 */
- "%regs4", "%regs5", "%regs6", "%regs7", "%regs8", "%regs9", "%sp",
- "%lr",
- /* r16 ~ r23 */
- "%exregs0", "%exregs1", "%exregs2", "%exregs3", "%exregs4",
- "%exregs5", "%exregs6", "%exregs7",
- /* r24 ~ r31 */
- "%exregs8", "%exregs9", "%exregs10", "%exregs11", "%exregs12",
- "%exregs13", "%exregs14", "%tls",
- "%pc", NULL, NULL, NULL, "%hi", "%lo", NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- "%epc",
-};
-#else
-#define CSKY_MAX_REGS 57
-const char *csky_dwarf_regs_table[CSKY_MAX_REGS] = {
- /* r0 ~ r8 */
- "%sp", "%regs9", "%a0", "%a1", "%a2", "%a3", "%regs0", "%regs1",
- /* r9 ~ r15 */
- "%regs2", "%regs3", "%regs4", "%regs5", "%regs6", "%regs7", "%regs8",
- "%lr",
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- "%epc",
-};
-#endif
-
-const char *get_arch_regstr(unsigned int n)
-{
- return (n < CSKY_MAX_REGS) ? csky_dwarf_regs_table[n] : NULL;
-}