diff options
author | Milton Miller <miltonm@bga.com> | 2007-07-07 01:18:51 -0500 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2007-07-07 10:13:31 -0500 |
commit | 6a99b1313208d05ba6d9c5d3858230d9ee785f8c (patch) | |
tree | 62b09906809ee39b3f29a443fe4edafc10a0589c /dtc.h | |
parent | ac6a5e26b4f2239d77eb4aa25383466833949006 (diff) | |
download | dtc-6a99b1313208d05ba6d9c5d3858230d9ee785f8c.zip dtc-6a99b1313208d05ba6d9c5d3858230d9ee785f8c.tar.gz dtc-6a99b1313208d05ba6d9c5d3858230d9ee785f8c.tar.bz2 |
dtc: implement labels on property data
Extend the parser grammer to allow labels before or after any
property data (string, cell list, or byte list), and any
byte or cell within the property data.
Store the labels using the same linked list structure as node
references, but using a parallel list.
When writing assembly output emit global labels as offsets from
the start of the definition of the data.
Note that the alignment for a cell list is done as part of the
opening < delimiter, not the = or , before it. To label a cell
after a string or byte list put the label inside the cell list.
For example,
prop = zero: [ aa bb ], two: < four: 1234 > eight: ;
will produce labels with offsets 0, 2, 4, and 8 bytes from
the beginning of the data for property prop.
Signed-off-by: Milton Miller <miltonm@bga.com>
Diffstat (limited to 'dtc.h')
-rw-r--r-- | dtc.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -111,10 +111,10 @@ struct data { char *val; int asize; struct fixup *refs; + struct fixup *labels; }; -#define empty_data \ - ((struct data){.len = 0, .val = NULL, .asize = 0, .refs = NULL}) +#define empty_data ((struct data){ /* all .members = 0 or NULL */ }) void fixup_free(struct fixup *f); void data_free(struct data d); @@ -135,6 +135,7 @@ struct data data_append_zeroes(struct data d, int len); struct data data_append_align(struct data d, int align); struct data data_add_fixup(struct data d, char *ref); +struct data data_add_label(struct data d, char *label); int data_is_one_string(struct data d); |