44 int fragment_offset,
char const **pathp)
47 const char *path =
NULL;
48 int path_len = 0, ret;
58 path =
fdt_getprop(fdto, fragment_offset,
"target-path", &path_len);
82 *pathp = path ? path :
NULL;
112 if (len !=
sizeof(*val))
116 if ((adj_val + delta) < adj_val)
216 const char *tree_val;
239 for (i = 0; i < fixup_len; i++) {
251 memcpy(&adj_val, tree_val + poffset,
sizeof(adj_val));
271 const char *fixup_child_name =
fdt_get_name(fdto, fixup_child,
355 const char *path,
uint32_t path_len,
357 int poffset,
const char *label)
359 const char *symbol_path;
362 int symbol_off, fixup_off;
389 name, name_len, poffset,
391 sizeof(phandle_prop));
430 const char *path, *
name, *fixup_end;
431 const char *fixup_str = value;
437 fixup_end =
memchr(value,
'\0', len);
440 fixup_len = fixup_end - fixup_str;
442 len -= fixup_len + 1;
443 value += fixup_len + 1;
446 sep =
memchr(fixup_str,
':', fixup_len);
447 if (!sep || *sep !=
':')
450 path_len = sep - path;
451 if (path_len == (fixup_len - 1))
454 fixup_len -= path_len + 1;
457 if (!sep || *sep !=
':')
460 name_len = sep -
name;
464 poffset =
strtoul(sep + 1, &endptr, 10);
465 if ((*endptr !=
'\0') || (endptr <= (sep + 1)))
469 path, path_len,
name, name_len,
497 int fixups_off, symbols_off;
543 void *fdto,
int node)
638 int len = 0, namelen;
682 int root_sym, ov_sym, prop, path_len, fragment, target;
683 int len, frag_name_len, ret, rel_path_len;
687 const char *frag_name;
688 const char *rel_path;
689 const char *target_path;
716 if (path_len < 1 ||
memchr(path,
'\0', path_len) != &path[path_len - 1])
726 s =
strchr(path + 1,
'/');
733 frag_name = path + 1;
734 frag_name_len = s - path - 1;
737 len =
sizeof(
"/__overlay__/") - 1;
738 if ((e - s) > len && (
memcmp(s,
"/__overlay__/", len) == 0)) {
741 rel_path_len = e - rel_path - 1;
742 }
else if ((e - s) == len
743 && (
memcmp(s,
"/__overlay__", len - 1) == 0)) {
779 len =
strlen(target_path);
783 len + (len > 1) + rel_path_len + 1, &p);
802 memcpy(buf, target_path, len + 1);
808 memcpy(buf + len + 1, rel_path, rel_path_len);
809 buf[len + 1 + rel_path_len] =
'\0';
static uint32_t overlay_get_target_phandle(const void *fdto, int fragment)
static int overlay_update_local_references(void *fdto, uint32_t delta)
static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off, int property)
static int overlay_merge(void *fdt, void *fdto)
static int overlay_update_local_node_references(void *fdto, int tree_node, int fixup_node, uint32_t delta)
static int overlay_adjust_node_phandles(void *fdto, int node, uint32_t delta)
static int overlay_fixup_phandles(void *fdt, void *fdto)
static int overlay_phandle_add_offset(void *fdt, int node, const char *name, uint32_t delta)
static int overlay_apply_node(void *fdt, int target, void *fdto, int node)
static int overlay_adjust_local_phandles(void *fdto, uint32_t delta)
int fdt_overlay_target_offset(const void *fdt, const void *fdto, int fragment_offset, char const **pathp)
static int overlay_fixup_one_phandle(void *fdt, void *fdto, int symbols_off, const char *path, uint32_t path_len, const char *name, uint32_t name_len, int poffset, const char *label)
static int get_path_len(const void *fdt, int nodeoffset)
int fdt_overlay_apply(void *fdt, void *fdto)
static int overlay_symbol_update(void *fdt, void *fdto)
uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
int fdt_path_offset(const void *fdt, const char *path)
int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name)
int fdt_parent_offset(const void *fdt, int nodeoffset)
const char * fdt_get_name(const void *fdt, int nodeoffset, int *len)
int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
int fdt_subnode_offset_namelen(const void *fdt, int offset, const char *name, int namelen)
int fdt_find_max_phandle(const void *fdt, uint32_t *phandle)
int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
const void * fdt_getprop(const void *fdt, int nodeoffset, const char *name, int *lenp)
int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen)
const void * fdt_getprop_by_offset(const void *fdt, int offset, const char **namep, int *lenp)
int fdt_add_subnode(void *fdt, int parentoffset, const char *name)
int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name, int len, void **prop_data)
int fdt_setprop(void *fdt, int nodeoffset, const char *name, const void *val, int len)
int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset, const char *name, int namelen, uint32_t idx, const void *val, int len)
MOSAPI char * strchr(const char *s, int c)
MOSAPI void * memchr(const void *m, int c, size_t n)
MOSAPI int memcmp(const void *s1, const void *s2, size_t n)
MOSAPI unsigned long strtoul(const char *nptr, char **endptr, int base)
#define FDT_ERR_BADPHANDLE
#define fdt_for_each_subnode(node, fdt, parent)
#define FDT_ERR_NOPHANDLES
static int fdt_setprop_inplace_u32(void *fdt, int nodeoffset, const char *name, uint32_t val)
#define FDT_ERR_BADOVERLAY
static void fdt_set_magic(void *fdt, uint32_t val)
#define fdt_for_each_property_offset(property, fdt, node)
static fdt32_t cpu_to_fdt32(uint32_t x)
static uint32_t fdt32_to_cpu(fdt32_t x)
#define FDT_RO_PROBE(fdt)
static void * memcpy(void *s1, const void *s2, size_t n)
static size_t strlen(const char *s)
#define tree_node(element)