# define NFPREG 33
#endif
-/* Implementation of linux_target_ops method "arch_setup". */
+/* Linux target op definitions for the RISC-V architecture. */
-static void
-riscv_arch_setup ()
+class riscv_target : public linux_process_target
+{
+public:
+
+ const regs_info *get_regs_info () override;
+
+protected:
+
+ void low_arch_setup () override;
+};
+
+/* The singleton target ops object. */
+
+static riscv_target the_riscv_target;
+
+/* Implementation of linux target ops method "low_arch_setup". */
+
+void
+riscv_target::low_arch_setup ()
{
static const char *expedite_regs[] = { "sp", "pc", NULL };
&riscv_regsets_info,
};
-/* Implementation of linux_target_ops method "regs_info". */
+/* Implementation of linux target ops method "get_regs_info". */
-static const struct regs_info *
-riscv_regs_info ()
+const regs_info *
+riscv_target::get_regs_info ()
{
return &riscv_regs;
}
/* RISC-V/Linux target operations. */
struct linux_target_ops the_low_target =
{
- riscv_arch_setup,
- riscv_regs_info,
NULL, /* cannot_fetch_register */
NULL, /* cannot_store_register */
riscv_fetch_register,
riscv_breakpoint_at,
};
+/* The linux target ops object. */
+
+linux_process_target *the_linux_target = &the_riscv_target;
+
/* Initialize the RISC-V/Linux target. */
void