+2021-01-02 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c: Change ALIGN to align_up.
+ * sim-main.h (ALIGN): Delete
+
2020-08-21 Simon Marchi <simon.marchi@polymtl.ca>
* configure.ac: Include config/pkg.m4.
sc.result = heap;
heap += sc.arg2;
/* Keep it page aligned. */
- heap = ALIGN (heap, 4096);
+ heap = align_up (heap, 4096);
break;
}
}
/* 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. */
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) \
#include "dv-bfin_trace.h"
#undef CLAMP
-#undef ALIGN
#define CLAMP(a, b, c) min (max (a, b), c)
-#define ALIGN(addr, size) (((addr) + ((size)-1)) & ~((size)-1))
/* TODO: Move all this trace logic to the common code. */
#define BFIN_TRACE_CORE(cpu, addr, size, map, val) \
+2021-01-02 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-bits.h (_ALIGNa, _FLOORa, ALIGN_8, ALIGN_16, ALIGN_PAGE,
+ FLOOR_PAGE): Delete unused macros.
+ (align_up, align_down): Define.
+
2020-08-10 Tom de Vries <tdevries@suse.de>
* sim-cpu.c: Include stdlib.h for free.
EXTEND*(VALUE): Convert the `*' bit value to the targets natural
word size. Sign extend the value if needed.
- ALIGN_*(VALUE): Round the value upwards so that it is aligned to a
- `_*' byte boundary.
-
- FLOOR_*(VALUE): Truncate the value so that it is aligned to a `_*'
- byte boundary.
+ align_*(VALUE, BYTES): Round the value so that it is aligned to a
+ BYTES boundary.
ROT*(VALUE, NR_BITS): Return the `*' bit VALUE rotated by NR_BITS
right (positive) or left (negative).
/* memory alignment macro's */
-#define _ALIGNa(A,X) (((X) + ((A) - 1)) & ~((A) - 1))
-#define _FLOORa(A,X) ((X) & ~((A) - 1))
-
-#define ALIGN_8(X) _ALIGNa (8, X)
-#define ALIGN_16(X) _ALIGNa (16, X)
-
-#define ALIGN_PAGE(X) _ALIGNa (0x1000, X)
-#define FLOOR_PAGE(X) ((X) & ~(0x1000 - 1))
+#define align_up(v, n) (((v) + (n) - 1) & -(n))
+#define align_down(v, n) ((v) & -(n))
/* bit bliting macro's */