Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl2/dtc/dist Reduce number of ALIGN macros defines...
details: https://anonhg.NetBSD.org/src/rev/5f2cc3daf565
branches: trunk
changeset: 354189:5f2cc3daf565
user: skrll <skrll%NetBSD.org@localhost>
date: Tue Jun 06 20:19:04 2017 +0000
description:
Reduce number of ALIGN macros defines and rename to avoid namespace clash
diffstat:
external/gpl2/dtc/dist/data.c | 2 +-
external/gpl2/dtc/dist/dtc.h | 2 --
external/gpl2/dtc/dist/fdtdump.c | 2 --
external/gpl2/dtc/dist/fdtput.c | 6 +++---
external/gpl2/dtc/dist/flattree.c | 4 ++--
external/gpl2/dtc/dist/srcpos.c | 2 +-
external/gpl2/dtc/dist/tests/mangle-layout.c | 2 +-
external/gpl2/dtc/dist/tests/move_and_save.c | 2 +-
external/gpl2/dtc/dist/tests/tests.h | 4 ++--
external/gpl2/dtc/dist/util.h | 2 ++
10 files changed, 13 insertions(+), 15 deletions(-)
diffs (149 lines):
diff -r cb917f045f0d -r 5f2cc3daf565 external/gpl2/dtc/dist/data.c
--- a/external/gpl2/dtc/dist/data.c Tue Jun 06 20:12:54 2017 +0000
+++ b/external/gpl2/dtc/dist/data.c Tue Jun 06 20:19:04 2017 +0000
@@ -233,7 +233,7 @@
struct data data_append_align(struct data d, int align)
{
- int newlen = ALIGN(d.len, align);
+ int newlen = FDTALIGN2(d.len, align);
return data_append_zeroes(d, newlen - d.len);
}
diff -r cb917f045f0d -r 5f2cc3daf565 external/gpl2/dtc/dist/dtc.h
--- a/external/gpl2/dtc/dist/dtc.h Tue Jun 06 20:12:54 2017 +0000
+++ b/external/gpl2/dtc/dist/dtc.h Tue Jun 06 20:19:04 2017 +0000
@@ -65,8 +65,6 @@
#define streq(a, b) (strcmp((a), (b)) == 0)
#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0)
-#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
-
/* Data blobs */
enum markertype {
REF_PHANDLE,
diff -r cb917f045f0d -r 5f2cc3daf565 external/gpl2/dtc/dist/fdtdump.c
--- a/external/gpl2/dtc/dist/fdtdump.c Tue Jun 06 20:12:54 2017 +0000
+++ b/external/gpl2/dtc/dist/fdtdump.c Tue Jun 06 20:19:04 2017 +0000
@@ -15,8 +15,6 @@
#include "util.h"
-#define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1))
-#define PALIGN(p, a) ((void *)(ALIGN((unsigned long)(p), (a))))
#define GET_CELL(p) (p += 4, *((const uint32_t *)(p-4)))
static const char *tagname(uint32_t tag)
diff -r cb917f045f0d -r 5f2cc3daf565 external/gpl2/dtc/dist/fdtput.c
--- a/external/gpl2/dtc/dist/fdtput.c Tue Jun 06 20:12:54 2017 +0000
+++ b/external/gpl2/dtc/dist/fdtput.c Tue Jun 06 20:19:04 2017 +0000
@@ -128,7 +128,7 @@
return 0;
}
-#define ALIGN(x) (((x) + (FDT_TAGSIZE) - 1) & ~((FDT_TAGSIZE) - 1))
+#define FDTALIGN(x) (((x) + (FDT_TAGSIZE) - 1) & ~((FDT_TAGSIZE) - 1))
static char *_realloc_fdt(char *fdt, int delta)
{
@@ -142,7 +142,7 @@
{
int delta;
/* FDT_BEGIN_NODE, node name in off_struct and FDT_END_NODE */
- delta = sizeof(struct fdt_node_header) + ALIGN(strlen(name) + 1)
+ delta = sizeof(struct fdt_node_header) + FDTALIGN(strlen(name) + 1)
+ FDT_TAGSIZE;
return _realloc_fdt(fdt, delta);
}
@@ -159,7 +159,7 @@
if (newlen > oldlen)
/* actual value in off_struct */
- delta += ALIGN(newlen) - ALIGN(oldlen);
+ delta += FDTALIGN(newlen) - FDTALIGN(oldlen);
return _realloc_fdt(fdt, delta);
}
diff -r cb917f045f0d -r 5f2cc3daf565 external/gpl2/dtc/dist/flattree.c
--- a/external/gpl2/dtc/dist/flattree.c Tue Jun 06 20:12:54 2017 +0000
+++ b/external/gpl2/dtc/dist/flattree.c Tue Jun 06 20:19:04 2017 +0000
@@ -350,7 +350,7 @@
fdt->last_comp_version = cpu_to_fdt32(vi->last_comp_version);
/* Reserve map should be doubleword aligned */
- reserve_off = ALIGN(vi->hdr_size, 8);
+ reserve_off = FDTALIGN2(vi->hdr_size, 8);
fdt->off_mem_rsvmap = cpu_to_fdt32(reserve_off);
fdt->off_dt_struct = cpu_to_fdt32(reserve_off + reservesize);
@@ -613,7 +613,7 @@
{
int off = inb->ptr - inb->base;
- inb->ptr = inb->base + ALIGN(off, align);
+ inb->ptr = inb->base + FDTALIGN2(off, align);
if (inb->ptr > inb->limit)
die("Premature end of data parsing flat device tree\n");
}
diff -r cb917f045f0d -r 5f2cc3daf565 external/gpl2/dtc/dist/srcpos.c
--- a/external/gpl2/dtc/dist/srcpos.c Tue Jun 06 20:12:54 2017 +0000
+++ b/external/gpl2/dtc/dist/srcpos.c Tue Jun 06 20:19:04 2017 +0000
@@ -226,7 +226,7 @@
current_srcfile->colno = 1;
} else if (text[i] == '\t') {
current_srcfile->colno =
- ALIGN(current_srcfile->colno, TAB_SIZE);
+ FDTALIGN2(current_srcfile->colno, TAB_SIZE);
} else {
current_srcfile->colno++;
}
diff -r cb917f045f0d -r 5f2cc3daf565 external/gpl2/dtc/dist/tests/mangle-layout.c
--- a/external/gpl2/dtc/dist/tests/mangle-layout.c Tue Jun 06 20:12:54 2017 +0000
+++ b/external/gpl2/dtc/dist/tests/mangle-layout.c Tue Jun 06 20:19:04 2017 +0000
@@ -95,7 +95,7 @@
}
oldsize = buf->size;
- offset = ALIGN(oldsize, align);
+ offset = FDTALIGN2(oldsize, align);
expand_buf(buf, offset+size);
memset(buf->buf + oldsize, 0, offset - oldsize);
diff -r cb917f045f0d -r 5f2cc3daf565 external/gpl2/dtc/dist/tests/move_and_save.c
--- a/external/gpl2/dtc/dist/tests/move_and_save.c Tue Jun 06 20:12:54 2017 +0000
+++ b/external/gpl2/dtc/dist/tests/move_and_save.c Tue Jun 06 20:19:04 2017 +0000
@@ -43,7 +43,7 @@
fdt = load_blob_arg(argc, argv);
inname = argv[1];
- shuntsize = ALIGN(fdt_totalsize(fdt) / 2, sizeof(uint64_t));
+ shuntsize = FDTALIGN2(fdt_totalsize(fdt) / 2, sizeof(uint64_t));
bufsize = fdt_totalsize(fdt) + shuntsize;
buf = xmalloc(bufsize);
diff -r cb917f045f0d -r 5f2cc3daf565 external/gpl2/dtc/dist/tests/tests.h
--- a/external/gpl2/dtc/dist/tests/tests.h Tue Jun 06 20:12:54 2017 +0000
+++ b/external/gpl2/dtc/dist/tests/tests.h Tue Jun 06 20:19:04 2017 +0000
@@ -32,8 +32,8 @@
extern char *test_name;
void test_init(int argc, char *argv[]);
-#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
-#define PALIGN(p, a) ((void *)ALIGN((unsigned long)(p), (a)))
+#define FDTALIGN2(x, a) (((x) + (a) - 1) & ~((a) - 1))
+#define PALIGN(p, a) ((void *)FDTALIGN2((unsigned long)(p), (a)))
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#define streq(s1, s2) (strcmp((s1),(s2)) == 0)
diff -r cb917f045f0d -r 5f2cc3daf565 external/gpl2/dtc/dist/util.h
--- a/external/gpl2/dtc/dist/util.h Tue Jun 06 20:12:54 2017 +0000
+++ b/external/gpl2/dtc/dist/util.h Tue Jun 06 20:19:04 2017 +0000
@@ -26,6 +26,8 @@
*/
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define FDTALIGN2(x, a) (((x) + (a) - 1) & ~((a) - 1))
+#define PALIGN(p, a) ((void *)(FDTALIGN2((unsigned long)(p), (a))))
static inline void __attribute__((noreturn)) die(const char *str, ...)
{
Home |
Main Index |
Thread Index |
Old Index