2 #ifndef LIBFDT_INTERNAL_H 3 #define LIBFDT_INTERNAL_H 10 #define FDT_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) 11 #define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE)) 13 int32_t fdt_ro_probe_(
const void *fdt);
14 #define FDT_RO_PROBE(fdt) \ 17 if ((totalsize_ = fdt_ro_probe_(fdt)) < 0) \ 21 int fdt_check_node_offset_(
const void *fdt,
int offset);
22 int fdt_check_prop_offset_(
const void *fdt,
int offset);
23 const char *fdt_find_string_(
const char *strtab,
int tabsize,
const char *s);
24 int fdt_node_end_offset_(
void *fdt,
int nodeoffset);
26 static inline const void *fdt_offset_ptr_(
const void *fdt,
int offset)
28 return (
const char *)fdt + fdt_off_dt_struct(fdt) + offset;
31 static inline void *fdt_offset_ptr_w_(
void *fdt,
int offset)
33 return (
void *)(uintptr_t)fdt_offset_ptr_(fdt, offset);
36 static inline const struct fdt_reserve_entry *fdt_mem_rsv_(
const void *fdt,
int n)
40 ((
const char *)fdt + fdt_off_mem_rsvmap(fdt));
46 return (
void *)(uintptr_t)fdt_mem_rsv_(fdt, n);
49 #define FDT_SW_MAGIC (~FDT_MAGIC) 55 #ifndef FDT_ASSUME_MASK 56 #define FDT_ASSUME_MASK 0 86 ASSUME_PERFECT = 0xff,
100 ASSUME_VALID_DTB = 1 << 0,
112 ASSUME_VALID_INPUT = 1 << 1,
121 ASSUME_LATEST = 1 << 2,
130 ASSUME_NO_ROLLBACK = 1 << 3,
138 ASSUME_LIBFDT_ORDER = 1 << 4,
147 static inline bool can_assume_(
int mask)
149 return FDT_ASSUME_MASK & mask;
153 #define can_assume(_assume) can_assume_(ASSUME_ ## _assume)