aboutsummaryrefslogtreecommitdiff
path: root/gdb/h8300-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-09-19 16:22:39 +0000
committerAndrew Cagney <cagney@redhat.com>2003-09-19 16:22:39 +0000
commit5b03f2662bf6d0e139ee4fbd089723a2e1b3deee (patch)
tree63386ca80e67a51370f3a6dc04673d74b8e27e13 /gdb/h8300-tdep.c
parent9f6c1c4b8b74fd670fc2af651dd5df989e109779 (diff)
downloadgdb-5b03f2662bf6d0e139ee4fbd089723a2e1b3deee.zip
gdb-5b03f2662bf6d0e139ee4fbd089723a2e1b3deee.tar.gz
gdb-5b03f2662bf6d0e139ee4fbd089723a2e1b3deee.tar.bz2
2003-09-19 Andrew Cagney <cagney@redhat.com>
* utils.c (align_up, align_down): New functions. * defs.h (align_up, align_down): Declare. * ppc-sysv-tdep.c (align_up, align_down): Delete functions. * s390-tdep.c: Replace "round_up" and "round_down" with "align_up" and "align_down". (round_up, round_down): Delete functions. * mips-tdep.c: Replace ROUND_UP and ROUND_DOWN with "align_up" and "align_down". (ROUND_DOWN, ROUND_UP): Delete macros. (mips_dump_tdep): Do not print "ROUND_UP" or "ROUND_DOWN". * h8300-tdep.c: Replace "round_up" and "round_down" with "align_up" and "align_down". (round_up, round_down): Delete macros. * frv-tdep.c: Replace ROUND_UP and ROUND_DOWN with "align_up" and "align_down". (ROUND_UP, ROUND_DOWN): Delete macros.
Diffstat (limited to 'gdb/h8300-tdep.c')
-rw-r--r--gdb/h8300-tdep.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index a2fab9a..77faad3 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -559,12 +559,6 @@ h8300_init_extra_frame_info (int fromleaf, struct frame_info *fi)
}
}
-/* Round N up or down to the nearest multiple of UNIT.
- Evaluate N only once, UNIT several times.
- UNIT must be a power of two. */
-#define round_up(n, unit) (((n) + (unit) - 1) & -(unit))
-#define round_down(n, unit) ((n) & -(unit))
-
/* Function: push_dummy_call
Setup the function arguments for calling a function in the inferior.
In this discussion, a `word' is 16 bits on the H8/300s, and 32 bits
@@ -641,12 +635,12 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
int argument;
/* First, make sure the stack is properly aligned. */
- sp = round_down (sp, wordsize);
+ sp = align_down (sp, wordsize);
/* Now make sure there's space on the stack for the arguments. We
may over-allocate a little here, but that won't hurt anything. */
for (argument = 0; argument < nargs; argument++)
- stack_alloc += round_up (TYPE_LENGTH (VALUE_TYPE (args[argument])),
+ stack_alloc += align_up (TYPE_LENGTH (VALUE_TYPE (args[argument])),
wordsize);
sp -= stack_alloc;
@@ -665,7 +659,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
char *contents = (char *) VALUE_CONTENTS (args[argument]);
/* Pad the argument appropriately. */
- int padded_len = round_up (len, wordsize);
+ int padded_len = align_up (len, wordsize);
char *padded = alloca (padded_len);
memset (padded, 0, padded_len);