summaryrefslogtreecommitdiff
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
commitbb0ddbd814f626274b20f642dd50c1e87ac60252 (patch)
treee51e8ae0f2670de0efa22b0bc285b29b1415fd27 /gdb/h8300-tdep.c
parente9c7e6b97baa06086aca732c7f2d00adeac934f3 (diff)
downloadgdb-bb0ddbd814f626274b20f642dd50c1e87ac60252.tar.gz
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 a2fab9a3217..77faad30482 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);