RISC-V: Make riscv_isa_xlen a global function.
authorJim Wilson <jimw@sifive.com>
Wed, 8 Aug 2018 17:48:09 +0000 (10:48 -0700)
committerJim Wilson <jimw@sifive.com>
Wed, 8 Aug 2018 17:51:40 +0000 (10:51 -0700)
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
gdb/riscv-tdep.c
gdb/riscv-tdep.h

index 682520f..d170a2e 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-08  Jim Wilson  <jimw@sifive.com>
+
+       * riscv-tdep.c (riscv_isa_xlen): Drop static.
+       * riscv-tdep.h (riscv_isa_xlen): Add extern declaration.
+
 2018-08-08  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        PR gdb/18050:
index abcac98..2018189 100644 (file)
@@ -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)
index 4fc0597..b35266d 100644 (file)
@@ -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 */