Automatic date update in version.in
[deliverable/binutils-gdb.git] / gdb / bfin-tdep.c
index 830cb1c2fd8ebf3dbb7afd87f5eb6496e55b4b89..e3d6eee8832e4dd335a672dc06074e7153c8cf1c 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for Analog Devices Blackfin processor, for GDB.
 
-   Copyright (C) 2005-2019 Free Software Foundation, Inc.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
    Contributed by Analog Devices, Inc.
 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-
-/* Local non-gdb includes.  */
+#include "inferior.h"
+#include "gdbcore.h"
 #include "arch-utils.h"
-#include "bfin-tdep.h"
+#include "regcache.h"
+#include "frame.h"
+#include "frame-unwind.h"
+#include "frame-base.h"
+#include "trad-frame.h"
 #include "dis-asm.h"
-#include "dwarf2-frame.h"
+#include "sim-regno.h"
+#include "gdb/sim-bfin.h"
+#include "dwarf2/frame.h"
+#include "symtab.h"
 #include "elf-bfd.h"
 #include "elf/bfin.h"
-#include "frame-base.h"
-#include "frame-unwind.h"
-#include "frame.h"
-#include "gdb/sim-bfin.h"
-#include "gdbcore.h"
-#include "infcall.h"
-#include "inferior.h"
 #include "osabi.h"
-#include "regcache.h"
-#include "sim-regno.h"
-#include "symtab.h"
-#include "trad-frame.h"
+#include "infcall.h"
 #include "xml-syscall.h"
+#include "bfin-tdep.h"
 
 /* Macros used by prologue functions.  */
 #define P_LINKAGE                      0xE800
@@ -512,7 +510,7 @@ bfin_push_dummy_call (struct gdbarch *gdbarch,
     {
       struct type *value_type = value_enclosing_type (args[i]);
 
-      total_len += (TYPE_LENGTH (value_type) + 3) & ~3;
+      total_len += align_up (TYPE_LENGTH (value_type), 4);
     }
 
   /* At least twelve bytes of stack space must be allocated for the function's
@@ -528,7 +526,7 @@ bfin_push_dummy_call (struct gdbarch *gdbarch,
     {
       struct type *value_type = value_enclosing_type (args[i]);
       struct type *arg_type = check_typedef (value_type);
-      int container_len = (TYPE_LENGTH (arg_type) + 3) & ~3;
+      int container_len = align_up (TYPE_LENGTH (arg_type), 4);
 
       sp -= container_len;
       write_memory (sp, value_contents (args[i]), container_len);
@@ -599,7 +597,7 @@ bfin_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
 
   *size = kind;
 
-  if (strcmp (target_shortname, "sim") == 0)
+  if (strcmp (target_shortname (), "sim") == 0)
     return bfin_sim_breakpoint;
   else
     return bfin_breakpoint;
@@ -761,7 +759,7 @@ static const struct frame_base bfin_frame_base =
 static CORE_ADDR
 bfin_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
 {
-  return (address & ~0x3);
+  return align_down (address, 4);
 }
 
 enum bfin_abi
@@ -835,8 +833,9 @@ bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   return gdbarch;
 }
 
+void _initialize_bfin_tdep ();
 void
-_initialize_bfin_tdep (void)
+_initialize_bfin_tdep ()
 {
   register_gdbarch_init (bfd_arch_bfin, bfin_gdbarch_init);
 }
This page took 0.024423 seconds and 4 git commands to generate.