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))
13int32_t fdt_ro_probe_(
const void *fdt);
14#define FDT_RO_PROBE(fdt) \
17 if ((totalsize_ = fdt_ro_probe_(fdt)) < 0) \
21int fdt_check_node_offset_(
const void *fdt,
int offset);
22int fdt_check_prop_offset_(
const void *fdt,
int offset);
23const char *fdt_find_string_(
const char *strtab,
int tabsize,
const char *s);
24int fdt_node_end_offset_(
void *fdt,
int nodeoffset);
26static inline const void *fdt_offset_ptr_(
const void *fdt,
int offset)
28 return (
const char *)fdt + fdt_off_dt_struct(fdt) + offset;
31static inline void *fdt_offset_ptr_w_(
void *fdt,
int offset)
33 return (
void *)(uintptr_t)fdt_offset_ptr_(fdt, offset);
40 ((
const char *)fdt + fdt_off_mem_rsvmap(fdt));
46 return (
void *)(uintptr_t)fdt_mem_rsv_(fdt, n);
58static inline uint32_t fdt32_ld_(
const fdt32_t *
p)
60 return fdt32_to_cpu(*
p);
63static inline uint64_t fdt64_ld_(
const fdt64_t *
p)
65 return fdt64_to_cpu(*
p);
68#define FDT_SW_MAGIC (~FDT_MAGIC)
74#ifndef FDT_ASSUME_MASK
75#define FDT_ASSUME_MASK 0
105 ASSUME_PERFECT = 0xff,
121 ASSUME_VALID_DTB = 1 << 0,
133 ASSUME_VALID_INPUT = 1 << 1,
142 ASSUME_LATEST = 1 << 2,
151 ASSUME_NO_ROLLBACK = 1 << 3,
166 ASSUME_LIBFDT_ORDER = 1 << 4,
175 ASSUME_LIBFDT_FLAWLESS = 1 << 5,
184static inline bool can_assume_(
int mask)
186 return FDT_ASSUME_MASK & mask;
190#define can_assume(_assume) can_assume_(ASSUME_ ## _assume)
unsigned p
Definition: tte.h:17