14 int mem_rsv_size,
int struct_size)
42#define FDT_RW_PROBE(fdt) \
45 if ((err_ = fdt_rw_probe_(fdt)) != 0) \
54static int fdt_splice_(
void *fdt,
void *splicepoint,
int oldlen,
int newlen)
56 char *p = splicepoint;
58 size_t soff = p - (
char *)fdt;
60 if ((oldlen < 0) || (soff + oldlen < soff) || (soff + oldlen > dsize))
62 if ((p < (
char *)fdt) || (dsize + newlen < (
unsigned)oldlen))
66 memmove(p + newlen, p + oldlen, ((
char *)fdt + dsize) - (p + oldlen));
73 int delta = (newn - oldn) *
sizeof(*p);
75 err =
fdt_splice_(fdt, p, oldn *
sizeof(*p), newn *
sizeof(*p));
84 int oldlen,
int newlen)
86 int delta = newlen - oldlen;
100 int newlen =
strlen(s) + 1;
107 void *p = (
char *)fdt
152 return (
new - strtab);
243 namep = (
char *)(uintptr_t)
fdt_get_name(fdt, nodeoffset, &oldlen);
259 int len,
void **prop_data)
272 *prop_data = prop->
data;
277 const void *val,
int len)
292 const void *val,
int len)
295 int err, oldlen, newlen;
301 newlen =
len + oldlen;
334 const char *
name,
int namelen)
337 int offset, nextoffset;
393 endoffset - nodeoffset, 0);
401 int mem_rsv_off, struct_off, strings_off;
404 struct_off = mem_rsv_off + mem_rsv_size;
405 strings_off = struct_off + struct_size;
422 int mem_rsv_size, struct_size;
424 const char *fdtstart = fdt;
461 if (bufsize < newsize)
467 if (((tmp + newsize) > fdtstart) && (tmp < fdtend)) {
469 tmp = (
char *)(uintptr_t)fdtend;
470 if ((tmp + newsize) > ((
char *)buf + bufsize))
const char * fdt_find_string_(const char *strtab, int tabsize, const char *s)
int fdt_move(const void *fdt, void *buf, int bufsize)
int fdt_check_node_offset_(const void *fdt, int offset)
uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
const char * fdt_get_name(const void *fdt, int nodeoffset, int *len)
int fdt_subnode_offset_namelen(const void *fdt, int offset, const char *name, int namelen)
int fdt_num_mem_rsv(const void *fdt)
int fdt_add_subnode(void *fdt, int parentoffset, const char *name)
int fdt_appendprop(void *fdt, int nodeoffset, const char *name, const void *val, int len)
static int fdt_find_add_string_(void *fdt, const char *s, int *allocated)
int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
int fdt_del_mem_rsv(void *fdt, int n)
static int fdt_splice_(void *fdt, void *splicepoint, int oldlen, int newlen)
static int fdt_add_property_(void *fdt, int nodeoffset, const char *name, int len, struct fdt_property **prop)
static void fdt_packblocks_(const char *old, char *new, int mem_rsv_size, int struct_size, int strings_size)
static unsigned int fdt_data_size_(void *fdt)
int fdt_delprop(void *fdt, int nodeoffset, const char *name)
int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name, int len, void **prop_data)
static int fdt_splice_mem_rsv_(void *fdt, struct fdt_reserve_entry *p, int oldn, int newn)
static int fdt_splice_struct_(void *fdt, void *p, int oldlen, int newlen)
static int fdt_blocks_misordered_(const void *fdt, int mem_rsv_size, int struct_size)
#define FDT_RW_PROBE(fdt)
static int fdt_rw_probe_(void *fdt)
int fdt_add_subnode_namelen(void *fdt, int parentoffset, const char *name, int namelen)
int fdt_open_into(const void *fdt, void *buf, int bufsize)
static int fdt_resize_property_(void *fdt, int nodeoffset, const char *name, int len, struct fdt_property **prop)
int fdt_del_node(void *fdt, int nodeoffset)
int fdt_set_name(void *fdt, int nodeoffset, const char *name)
static void fdt_del_last_string_(void *fdt, const char *s)
static int fdt_splice_string_(void *fdt, int newlen)
int fdt_setprop(void *fdt, int nodeoffset, const char *name, const void *val, int len)
int fdt_node_end_offset_(void *fdt, int offset)
MOSAPI void * memmove(void *dest, const void *src, size_t n)
static void fdt_set_last_comp_version(void *fdt, uint32_t val)
#define fdt_totalsize(fdt)
static void fdt_set_size_dt_strings(void *fdt, uint32_t val)
static struct fdt_property * fdt_get_property_w(void *fdt, int nodeoffset, const char *name, int *lenp)
static void fdt_set_version(void *fdt, uint32_t val)
static void fdt_set_size_dt_struct(void *fdt, uint32_t val)
#define FDT_ERR_BADOFFSET
static void fdt_set_totalsize(void *fdt, uint32_t val)
static void fdt_set_off_dt_struct(void *fdt, uint32_t val)
#define fdt_size_dt_struct(fdt)
#define fdt_off_dt_strings(fdt)
#define fdt_size_dt_strings(fdt)
static void fdt_set_boot_cpuid_phys(void *fdt, uint32_t val)
static void fdt_set_off_mem_rsvmap(void *fdt, uint32_t val)
static void fdt_set_off_dt_strings(void *fdt, uint32_t val)
static void fdt_set_magic(void *fdt, uint32_t val)
#define FDT_ERR_BADVERSION
#define fdt_off_mem_rsvmap(fdt)
#define fdt_boot_cpuid_phys(fdt)
#define FDT_ERR_BADLAYOUT
#define fdt_off_dt_struct(fdt)
static fdt32_t cpu_to_fdt32(uint32_t x)
static fdt64_t cpu_to_fdt64(uint64_t x)
static void * fdt_offset_ptr_w_(void *fdt, int offset)
static struct fdt_reserve_entry * fdt_mem_rsv_w_(void *fdt, int n)
#define FDT_RO_PROBE(fdt)
#define can_assume(_assume)
static void * memcpy(void *s1, const void *s2, size_t n)
static void * memset(void *s, int c, size_t n)
static size_t strlen(const char *s)
unsigned long long uint64_t