AArch64: Revert setting of elf class in linker stub.
[deliverable/binutils-gdb.git] / gdb / rs6000-lynx178-tdep.c
index 47fcc62637fa07f3f48c15a46c2002bad333464d..bf5d9d859d22c3424753ac72fccef50d842b9714 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2013 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,6 +22,7 @@
 #include "gdbtypes.h"
 #include "infcall.h"
 #include "ppc-tdep.h"
+#include "target-float.h"
 #include "value.h"
 #include "xcoffread.h"
 
@@ -32,7 +33,8 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
                                struct value *function,
                                struct regcache *regcache, CORE_ADDR bp_addr,
                                int nargs, struct value **args, CORE_ADDR sp,
-                               int struct_return, CORE_ADDR struct_addr)
+                               function_call_return_method return_method,
+                               CORE_ADDR struct_addr)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -43,7 +45,6 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
   gdb_byte tmp_buffer[50];
   int f_argno = 0;             /* current floating point argno */
   int wordsize = gdbarch_tdep (gdbarch)->wordsize;
-  CORE_ADDR func_addr = find_function_addr (function, NULL);
 
   struct value *arg = 0;
   struct type *type;
@@ -63,7 +64,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
      (which will be passed in r3) is used for struct return address.
      In that case we should advance one word and start from r4
      register to copy parameters.  */
-  if (struct_return)
+  if (return_method == return_method_struct)
     {
       regcache_raw_write_unsigned (regcache, tdep->ppc_gp0_regnum + 3,
                                   struct_addr);
@@ -105,14 +106,13 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
             Always store the floating point value using the register's
             floating-point format.  */
          const int fp_regnum = tdep->ppc_fp0_regnum + 1 + f_argno;
-         gdb_byte reg_val[MAX_REGISTER_SIZE];
+         gdb_byte reg_val[PPC_MAX_REGISTER_SIZE];
          struct type *reg_type = register_type (gdbarch, fp_regnum);
 
          gdb_assert (len <= 8);
 
-         convert_typed_floating (value_contents (arg), type,
-                                 reg_val, reg_type);
-         regcache_cooked_write (regcache, fp_regnum, reg_val);
+         target_float_convert (value_contents (arg), type, reg_val, reg_type);
+         regcache->cooked_write (fp_regnum, reg_val);
          ++f_argno;
        }
 
@@ -122,15 +122,13 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
          /* Argument takes more than one register.  */
          while (argbytes < len)
            {
-             gdb_byte word[MAX_REGISTER_SIZE];
+             gdb_byte word[PPC_MAX_REGISTER_SIZE];
              memset (word, 0, reg_size);
              memcpy (word,
                      ((char *) value_contents (arg)) + argbytes,
                      (len - argbytes) > reg_size
                        ? reg_size : len - argbytes);
-             regcache_cooked_write (regcache,
-                                   tdep->ppc_gp0_regnum + 3 + ii,
-                                   word);
+             regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word);
              ++ii, argbytes += reg_size;
 
              if (ii >= 8)
@@ -142,13 +140,11 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
       else
        {
          /* Argument can fit in one register.  No problem.  */
-         int adj = gdbarch_byte_order (gdbarch)
-                   == BFD_ENDIAN_BIG ? reg_size - len : 0;
-         gdb_byte word[MAX_REGISTER_SIZE];
+         gdb_byte word[PPC_MAX_REGISTER_SIZE];
 
          memset (word, 0, reg_size);
          memcpy (word, value_contents (arg), len);
-         regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3 +ii, word);
+         regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
        }
       ++argno;
     }
@@ -231,9 +227,8 @@ ran_out_of_registers_for_arguments:
 
              gdb_assert (len <= 8);
 
-             regcache_cooked_write (regcache,
-                                    tdep->ppc_fp0_regnum + 1 + f_argno,
-                                    value_contents (arg));
+             regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno,
+                                     value_contents (arg));
              ++f_argno;
            }
 
@@ -283,9 +278,9 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
       && TYPE_LENGTH (valtype) == 16)
     {
       if (readbuf)
-       regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf);
+       regcache->cooked_read (tdep->ppc_vr0_regnum + 2, readbuf);
       if (writebuf)
-       regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
+       regcache->cooked_write (tdep->ppc_vr0_regnum + 2, writebuf);
 
       return RETURN_VALUE_REGISTER_CONVENTION;
     }
@@ -315,13 +310,13 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
 
       if (readbuf)
        {
-         regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
-         convert_typed_floating (regval, regtype, readbuf, valtype);
+         regcache->cooked_read (tdep->ppc_fp0_regnum + 1, regval);
+         target_float_convert (regval, regtype, readbuf, valtype);
        }
       if (writebuf)
        {
-         convert_typed_floating (writebuf, valtype, regval, regtype);
-         regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
+         target_float_convert (writebuf, valtype, regval, regtype);
+         regcache->cooked_write (tdep->ppc_fp0_regnum + 1, regval);
        }
 
       return RETURN_VALUE_REGISTER_CONVENTION;
@@ -367,16 +362,14 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
        {
          gdb_byte regval[8];
 
-         regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, regval);
-         regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
-                               regval + 4);
+         regcache->cooked_read (tdep->ppc_gp0_regnum + 3, regval);
+         regcache->cooked_read (tdep->ppc_gp0_regnum + 4, regval + 4);
          memcpy (readbuf, regval, 8);
        }
       if (writebuf)
        {
-         regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, writebuf);
-         regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
-                                writebuf + 4);
+         regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf);
+         regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4);
        }
 
       return RETURN_VALUE_REGISTER_CONVENTION;
@@ -413,9 +406,6 @@ rs6000_lynx178_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
 }
 
-/* -Wmissing-prototypes.  */
-extern initialize_file_ftype _initialize_rs6000_lynx178_tdep;
-
 void
 _initialize_rs6000_lynx178_tdep (void)
 {
This page took 0.02803 seconds and 4 git commands to generate.