Remove "noisy" parameter from clear_complaints
[deliverable/binutils-gdb.git] / gdb / mips-linux-tdep.c
index 57e75b5343e1b927e9fe28dea16759f769cf4506..175b4024d168a62bd9a0d6a9bbe63074934faa98 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for GNU/Linux on MIPS processors.
 
-   Copyright (C) 2001-2017 Free Software Foundation, Inc.
+   Copyright (C) 2001-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "xml-syscall.h"
 #include "gdb_signals.h"
 
+#include "features/mips-linux.c"
+#include "features/mips-dsp-linux.c"
+#include "features/mips64-linux.c"
+#include "features/mips64-dsp-linux.c"
+
 static struct target_so_ops mips_svr4_so_ops;
 
 /* This enum represents the signals' numbers on the MIPS
@@ -116,13 +121,7 @@ mips_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
 static void
 supply_32bit_reg (struct regcache *regcache, int regnum, const void *addr)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  gdb_byte buf[MAX_REGISTER_SIZE];
-  store_signed_integer (buf, register_size (gdbarch, regnum), byte_order,
-                       extract_signed_integer ((const gdb_byte *) addr, 4,
-                                               byte_order));
-  regcache_raw_supply (regcache, regnum, buf);
+  regcache->raw_supply_integer (regnum, (const gdb_byte *) addr, 4, true);
 }
 
 /* Unpack an elf_gregset_t into GDB's register cache.  */
@@ -133,10 +132,7 @@ mips_supply_gregset (struct regcache *regcache,
 {
   int regi;
   const mips_elf_greg_t *regp = *gregsetp;
-  char zerobuf[MAX_REGISTER_SIZE];
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
-
-  memset (zerobuf, 0, MAX_REGISTER_SIZE);
+  struct gdbarch *gdbarch = regcache->arch ();
 
   for (regi = EF_REG0 + 1; regi <= EF_REG31; regi++)
     supply_32bit_reg (regcache, regi - EF_REG0, regp + regi);
@@ -156,7 +152,7 @@ mips_supply_gregset (struct regcache *regcache,
                    regp + EF_CP0_CAUSE);
 
   /* Fill the inaccessible zero register with zero.  */
-  regcache_raw_supply (regcache, MIPS_ZERO_REGNUM, zerobuf);
+  regcache->raw_supply_zeroed (MIPS_ZERO_REGNUM);
 }
 
 static void
@@ -175,7 +171,7 @@ void
 mips_fill_gregset (const struct regcache *regcache,
                   mips_elf_gregset_t *gregsetp, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int regaddr, regi;
   mips_elf_greg_t *regp = *gregsetp;
   void *dst;
@@ -243,11 +239,8 @@ void
 mips_supply_fpregset (struct regcache *regcache,
                      const mips_elf_fpregset_t *fpregsetp)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int regi;
-  char zerobuf[MAX_REGISTER_SIZE];
-
-  memset (zerobuf, 0, MAX_REGISTER_SIZE);
 
   for (regi = 0; regi < 32; regi++)
     regcache_raw_supply (regcache,
@@ -259,9 +252,8 @@ mips_supply_fpregset (struct regcache *regcache,
                       *fpregsetp + 32);
 
   /* FIXME: how can we supply FCRIR?  The ABI doesn't tell us.  */
-  regcache_raw_supply (regcache,
-                      mips_regnum (gdbarch)->fp_implementation_revision,
-                      zerobuf);
+  regcache->raw_supply_zeroed
+    (mips_regnum (gdbarch)->fp_implementation_revision);
 }
 
 static void
@@ -281,7 +273,7 @@ void
 mips_fill_fpregset (const struct regcache *regcache,
                    mips_elf_fpregset_t *fpregsetp, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   char *to;
 
   if ((regno >= gdbarch_fp0_regnum (gdbarch))
@@ -363,7 +355,7 @@ static void
 supply_64bit_reg (struct regcache *regcache, int regnum,
                  const gdb_byte *buf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG
       && register_size (gdbarch, regnum) == 4)
     regcache_raw_supply (regcache, regnum, buf + 4);
@@ -379,10 +371,7 @@ mips64_supply_gregset (struct regcache *regcache,
 {
   int regi;
   const mips64_elf_greg_t *regp = *gregsetp;
-  gdb_byte zerobuf[MAX_REGISTER_SIZE];
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
-
-  memset (zerobuf, 0, MAX_REGISTER_SIZE);
+  struct gdbarch *gdbarch = regcache->arch ();
 
   for (regi = MIPS64_EF_REG0 + 1; regi <= MIPS64_EF_REG31; regi++)
     supply_64bit_reg (regcache, regi - MIPS64_EF_REG0,
@@ -407,7 +396,7 @@ mips64_supply_gregset (struct regcache *regcache,
                    (const gdb_byte *) (regp + MIPS64_EF_CP0_CAUSE));
 
   /* Fill the inaccessible zero register with zero.  */
-  regcache_raw_supply (regcache, MIPS_ZERO_REGNUM, zerobuf);
+  regcache->raw_supply_zeroed (MIPS_ZERO_REGNUM);
 }
 
 static void
@@ -426,8 +415,7 @@ void
 mips64_fill_gregset (const struct regcache *regcache,
                     mips64_elf_gregset_t *gregsetp, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+  struct gdbarch *gdbarch = regcache->arch ();
   int regaddr, regi;
   mips64_elf_greg_t *regp = *gregsetp;
   void *dst;
@@ -470,14 +458,8 @@ mips64_fill_gregset (const struct regcache *regcache,
 
   if (regaddr != -1)
     {
-      gdb_byte buf[MAX_REGISTER_SIZE];
-      LONGEST val;
-
-      regcache_raw_collect (regcache, regno, buf);
-      val = extract_signed_integer (buf, register_size (gdbarch, regno),
-                                   byte_order);
       dst = regp + regaddr;
-      store_signed_integer ((gdb_byte *) dst, 8, byte_order, val);
+      regcache->raw_collect_integer (regno, (gdb_byte *) dst, 8, true);
     }
 }
 
@@ -497,7 +479,7 @@ void
 mips64_supply_fpregset (struct regcache *regcache,
                        const mips64_elf_fpregset_t *fpregsetp)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int regi;
 
   /* See mips_linux_o32_sigframe_init for a description of the
@@ -547,8 +529,7 @@ void
 mips64_fill_fpregset (const struct regcache *regcache,
                      mips64_elf_fpregset_t *fpregsetp, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+  struct gdbarch *gdbarch = regcache->arch ();
   gdb_byte *to;
 
   if ((regno >= gdbarch_fp0_regnum (gdbarch))
@@ -574,25 +555,13 @@ mips64_fill_fpregset (const struct regcache *regcache,
     }
   else if (regno == mips_regnum (gdbarch)->fp_control_status)
     {
-      gdb_byte buf[MAX_REGISTER_SIZE];
-      LONGEST val;
-
-      regcache_raw_collect (regcache, regno, buf);
-      val = extract_signed_integer (buf, register_size (gdbarch, regno),
-                                   byte_order);
       to = (gdb_byte *) (*fpregsetp + 32);
-      store_signed_integer (to, 4, byte_order, val);
+      regcache->raw_collect_integer (regno, to, 4, true);
     }
   else if (regno == mips_regnum (gdbarch)->fp_implementation_revision)
     {
-      gdb_byte buf[MAX_REGISTER_SIZE];
-      LONGEST val;
-
-      regcache_raw_collect (regcache, regno, buf);
-      val = extract_signed_integer (buf, register_size (gdbarch, regno),
-                                   byte_order);
       to = (gdb_byte *) (*fpregsetp + 32) + 4;
-      store_signed_integer (to, 4, byte_order, val);
+      regcache->raw_collect_integer (regno, to, 4, true);
     }
   else if (regno == -1)
     {
@@ -1382,7 +1351,7 @@ micromips_linux_sigframe_validate (const struct tramp_frame *self,
 static void
 mips_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
 
   mips_write_pc (regcache, pc);
 
@@ -1646,8 +1615,7 @@ mips_linux_init_abi (struct gdbarch_info info,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum mips_abi abi = mips_abi (gdbarch);
-  struct tdesc_arch_data *tdesc_data
-    = (struct tdesc_arch_data *) info.tdep_info;
+  struct tdesc_arch_data *tdesc_data = info.tdesc_data;
 
   linux_init_abi (info, gdbarch);
 
@@ -1758,9 +1726,6 @@ mips_linux_init_abi (struct gdbarch_info info,
     }
 }
 
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-extern initialize_file_ftype _initialize_mips_linux_tdep;
-
 void
 _initialize_mips_linux_tdep (void)
 {
@@ -1774,4 +1739,10 @@ _initialize_mips_linux_tdep (void)
                              GDB_OSABI_LINUX,
                              mips_linux_init_abi);
     }
+
+  /* Initialize the standard target descriptions.  */
+  initialize_tdesc_mips_linux ();
+  initialize_tdesc_mips_dsp_linux ();
+  initialize_tdesc_mips64_linux ();
+  initialize_tdesc_mips64_dsp_linux ();
 }
This page took 0.02887 seconds and 4 git commands to generate.