From 411baa470ef354e50b488c0c736ac7af8d856ded Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Wed, 8 Aug 2018 10:48:09 -0700 Subject: [PATCH] RISC-V: Make riscv_isa_xlen a global function. This allows the function to be used from riscv OS files, which also need to depend on XLEN size. gdb/ * riscv-tdep.c (riscv_isa_xlen): Drop static. * riscv-tdep.h (riscv_isa_xlen): Add extern declaration. --- gdb/ChangeLog | 5 +++++ gdb/riscv-tdep.c | 2 +- gdb/riscv-tdep.h | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 682520fc400..d170a2eace7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-08-08 Jim Wilson + + * riscv-tdep.c (riscv_isa_xlen): Drop static. + * riscv-tdep.h (riscv_isa_xlen): Add extern declaration. + 2018-08-08 Andrew Burgess PR gdb/18050: diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index abcac98016d..20181896c5f 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -346,7 +346,7 @@ riscv_has_feature (struct gdbarch *gdbarch, char feature) Possible return values are 4, 8, or 16 for RiscV variants RV32, RV64, or RV128. */ -static int +int riscv_isa_xlen (struct gdbarch *gdbarch) { switch (gdbarch_tdep (gdbarch)->abi.fields.base_len) diff --git a/gdb/riscv-tdep.h b/gdb/riscv-tdep.h index 4fc05976ba8..b35266daf74 100644 --- a/gdb/riscv-tdep.h +++ b/gdb/riscv-tdep.h @@ -76,4 +76,7 @@ struct gdbarch_tdep unsigned core_features; }; +/* Return the width in bytes of the general purpose registers for GDBARCH. */ +extern int riscv_isa_xlen (struct gdbarch *gdbarch); + #endif /* RISCV_TDEP_H */ -- 2.30.2