1 #ifndef LIBFDT_INTERNAL_H 2 #define LIBFDT_INTERNAL_H 55 #define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) 56 #define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE)) 58 int fdt_ro_probe_(
const void *fdt);
59 #define FDT_RO_PROBE(fdt) \ 62 if ((err_ = fdt_ro_probe_(fdt)) != 0) \ 66 int fdt_check_node_offset_(
const void *fdt,
int offset);
67 int fdt_check_prop_offset_(
const void *fdt,
int offset);
68 const char *fdt_find_string_(
const char *strtab,
int tabsize,
const char *s);
69 int fdt_node_end_offset_(
void *fdt,
int nodeoffset);
71 static inline const void *fdt_offset_ptr_(
const void *fdt,
int offset)
73 return (
const char *)fdt + fdt_off_dt_struct(fdt) + offset;
76 static inline void *fdt_offset_ptr_w_(
void *fdt,
int offset)
78 return (
void *)(uintptr_t)fdt_offset_ptr_(fdt, offset);
81 static inline const struct fdt_reserve_entry *fdt_mem_rsv_(
const void *fdt,
int n)
85 ((
const char *)fdt + fdt_off_mem_rsvmap(fdt));
91 return (
void *)(uintptr_t)fdt_mem_rsv_(fdt, n);
94 #define FDT_SW_MAGIC (~FDT_MAGIC)