public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH/committed] gdb: bfin: use align helper
@ 2021-01-04 23:24 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-01-04 23:24 UTC (permalink / raw)
  To: gdb-patches

---
 gdb/ChangeLog   | 5 +++++
 gdb/bfin-tdep.c | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 86a8b482fcbf..7ece6c75d9cd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2021-01-04  Mike Frysinger  <vapier@gentoo.org>
+
+	* bfin-tdep.c (bfin_push_dummy_call): Use align_up.
+	(bfin_frame_align): Use align_down.
+
 2021-01-04  Tom de Vries  <tdevries@suse.de>
 
 	* buildsym.c (buildsym_compunit::record_line): Filter out end-of-seq
diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
index fc3258a4619a..963b0485a48a 100644
--- a/gdb/bfin-tdep.c
+++ b/gdb/bfin-tdep.c
@@ -510,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
@@ -526,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);
@@ -759,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
-- 
2.28.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-04 23:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04 23:24 [PATCH/committed] gdb: bfin: use align helper Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).