diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2007-12-05 10:43:50 +1100 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2007-12-05 08:28:44 -0600 |
commit | efbbef8e4f86f8043760f1e48b25ab2795ba3524 (patch) | |
tree | 78ab6f7d4509d31ce0f95da33d357e00e60a6d5e /data.c | |
parent | 80c72a81cffdfde0965853d1ea834352b3e91f89 (diff) | |
download | dtc-efbbef8e4f86f8043760f1e48b25ab2795ba3524.zip dtc-efbbef8e4f86f8043760f1e48b25ab2795ba3524.tar.gz dtc-efbbef8e4f86f8043760f1e48b25ab2795ba3524.tar.bz2 |
dtc: Implement path references
This patch extends dtc syntax to allow references (&label, or
&{/full/path}) directly within property definitions, rather than
inside a cell list. Such references are expanded to the full path of
the referenced node, as a string, instead of to a phandle as
references within cell lists are evaluated.
A testcase is also included.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -202,6 +202,21 @@ struct data data_append_data(struct data d, const void *p, int len) return d; } +struct data data_insert_at_marker(struct data d, struct marker *m, + const void *p, int len) +{ + d = data_grow_for(d, len); + memmove(d.val + m->offset + len, d.val + m->offset, d.len - m->offset); + memcpy(d.val + m->offset, p, len); + d.len += len; + + /* Adjust all markers after the one we're inserting at */ + m = m->next; + for_each_marker(m) + m->offset += len; + return d; +} + struct data data_append_markers(struct data d, struct marker *m) { struct marker **mp = &d.markers; |