diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-19 19:04:47 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-19 19:04:47 +0200 |
commit | 3e10e879a8c334a5927d800a3663a24d562cfa31 (patch) | |
tree | 5d18bc7e38c986a044e99aa0d0a4aff4931ec7d0 /arch/powerpc/boot/libfdt/libfdt_internal.h | |
parent | 98d9c66ab07471006fd7910cb16453581c41a3e7 (diff) | |
parent | 0cfd81031a26717fe14380d18275f8e217571615 (diff) |
Merge branch 'linus' into tracing-v28-for-linus-v3
Conflicts:
init/main.c
kernel/module.c
scripts/bootgraph.pl
Diffstat (limited to 'arch/powerpc/boot/libfdt/libfdt_internal.h')
-rw-r--r-- | arch/powerpc/boot/libfdt/libfdt_internal.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/arch/powerpc/boot/libfdt/libfdt_internal.h b/arch/powerpc/boot/libfdt/libfdt_internal.h index 1e60936beb5..46eb93e4af5 100644 --- a/arch/powerpc/boot/libfdt/libfdt_internal.h +++ b/arch/powerpc/boot/libfdt/libfdt_internal.h @@ -52,38 +52,44 @@ */ #include <fdt.h> -#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) -#define PALIGN(p, a) ((void *)ALIGN((unsigned long)(p), (a))) +#define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) +#define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE)) -#define memeq(p, q, n) (memcmp((p), (q), (n)) == 0) -#define streq(p, q) (strcmp((p), (q)) == 0) +#define FDT_CHECK_HEADER(fdt) \ + { \ + int err; \ + if ((err = fdt_check_header(fdt)) != 0) \ + return err; \ + } uint32_t _fdt_next_tag(const void *fdt, int startoffset, int *nextoffset); +int _fdt_check_node_offset(const void *fdt, int offset); const char *_fdt_find_string(const char *strtab, int tabsize, const char *s); int _fdt_node_end_offset(void *fdt, int nodeoffset); static inline const void *_fdt_offset_ptr(const void *fdt, int offset) { - return fdt + fdt_off_dt_struct(fdt) + offset; + return (const char *)fdt + fdt_off_dt_struct(fdt) + offset; } static inline void *_fdt_offset_ptr_w(void *fdt, int offset) { - return (void *)_fdt_offset_ptr(fdt, offset); + return (void *)(uintptr_t)_fdt_offset_ptr(fdt, offset); } static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n) { const struct fdt_reserve_entry *rsv_table = - fdt + fdt_off_mem_rsvmap(fdt); + (const struct fdt_reserve_entry *) + ((const char *)fdt + fdt_off_mem_rsvmap(fdt)); return rsv_table + n; } static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n) { - return (void *)_fdt_mem_rsv(fdt, n); + return (void *)(uintptr_t)_fdt_mem_rsv(fdt, n); } -#define SW_MAGIC (~FDT_MAGIC) +#define FDT_SW_MAGIC (~FDT_MAGIC) #endif /* _LIBFDT_INTERNAL_H */ |