diff options
author | Jon Loeliger <jdl@freescale.com> | 2007-02-15 10:59:27 -0600 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2007-02-15 10:59:27 -0600 |
commit | af0278a3a04fabe8349cae89613274da196509ca (patch) | |
tree | ba74a8c677097a342c42f7755295444f25d8efb8 /dtc-parser.y | |
parent | c226ddcabc4272b0734d237d3aee2c21a2fe2387 (diff) | |
download | dtc-af0278a3a04fabe8349cae89613274da196509ca.tar.gz |
Add support for decimal, octal and binary based cell values.
New syntax d#, b#, o# and h# allow for an explicit prefix
on cell values to specify their base. Eg: <d# 123>
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Diffstat (limited to 'dtc-parser.y')
-rw-r--r-- | dtc-parser.y | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/dtc-parser.y b/dtc-parser.y index bd725fe..992fdb1 100644 --- a/dtc-parser.y +++ b/dtc-parser.y @@ -33,6 +33,7 @@ extern struct boot_info *the_boot_info; %union { cell_t cval; + unsigned int cbase; u8 byte; char *str; struct data data; @@ -50,7 +51,8 @@ extern struct boot_info *the_boot_info; %token <addr> DT_ADDR %token <str> DT_PROPNAME %token <str> DT_NODENAME -%token <cval> DT_CELL +%token <cbase> DT_BASE +%token <str> DT_CELL %token <byte> DT_BYTE %token <data> DT_STRING %token <str> DT_UNIT @@ -61,6 +63,7 @@ extern struct boot_info *the_boot_info; %type <data> propdataprefix %type <re> memreserve %type <re> memreserves +%type <cbase> opt_cell_base %type <data> celllist %type <data> bytestring %type <prop> propdef @@ -133,7 +136,16 @@ propdataprefix: propdata ',' { $$ = $1; } | /* empty */ { $$ = empty_data; } ; -celllist: celllist DT_CELL { $$ = data_append_cell($1, $2); } +opt_cell_base: + /* empty */ + { $$ = 16; } + | DT_BASE + ; + +celllist: celllist opt_cell_base DT_CELL { + $$ = data_append_cell($1, + data_convert_cell($3, $2)); + } | celllist DT_REF { $$ = data_append_cell(data_add_fixup($1, $2), -1); } |