diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-06-23 22:17:47 +0545 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-01-02 20:55:21 -0500 |
commit | 0ede24f2c46d2b888f5e19418e577f3c1110f6a5 (patch) | |
tree | fa410e70e724d2dc61347f24e137b9aecbcc6efb /sim/bfin/interp.c | |
parent | 3b47e132c439a5ac477bc07fab06edaa45fa0533 (diff) | |
download | fsf-binutils-gdb-0ede24f2c46d2b888f5e19418e577f3c1110f6a5.zip fsf-binutils-gdb-0ede24f2c46d2b888f5e19418e577f3c1110f6a5.tar.gz fsf-binutils-gdb-0ede24f2c46d2b888f5e19418e577f3c1110f6a5.tar.bz2 |
sim: common: add align_{up,down} to match gdb
We have ALIGN_{8,16,PAGE} and FLOOR_PAGE macros (where PAGE is defined as
4k) which were imported from the ppc sim. But no other sim utilizes these
and hardcoding the sizes in the name is a bit limiting.
Let's delete these and import the two general macros that gdb uses:
align_up(addr, bytes)
align_down(addr, bytes)
This in turn allows us to cut over the Blackfin code immediately.
Diffstat (limited to 'sim/bfin/interp.c')
-rw-r--r-- | sim/bfin/interp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c index 5b05aa5..e26a822 100644 --- a/sim/bfin/interp.c +++ b/sim/bfin/interp.c @@ -289,7 +289,7 @@ bfin_syscall (SIM_CPU *cpu) sc.result = heap; heap += sc.arg2; /* Keep it page aligned. */ - heap = ALIGN (heap, 4096); + heap = align_up (heap, 4096); break; } @@ -948,7 +948,8 @@ bfin_fdpic_load (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd, bu32 *sp, } /* Update the load offset with a few extra pages. */ - fdpic_load_offset = ALIGN (max (max_load_addr, fdpic_load_offset), 0x10000); + fdpic_load_offset = align_up (max (max_load_addr, fdpic_load_offset), + 0x10000); fdpic_load_offset += 0x10000; /* Push the summary loadmap info onto the stack last. */ @@ -1074,7 +1075,7 @@ bfin_user_init (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd, env_flat += strlen (env[i]); /* Push the Auxiliary Vector Table between argv/env and actual strings. */ - sp_flat = sp = ALIGN (SPREG - argv_flat - env_flat - 4, 4); + sp_flat = sp = align_up (SPREG - argv_flat - env_flat - 4, 4); if (auxvt) { # define AT_PUSH(at, val) \ |