From 5b03f2662bf6d0e139ee4fbd089723a2e1b3deee Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 19 Sep 2003 16:22:39 +0000 Subject: 2003-09-19 Andrew Cagney * 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. --- gdb/h8300-tdep.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'gdb/h8300-tdep.c') 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); -- cgit v1.1