[coreboot-gerrit] Patch set updated for coreboot: sconfig: Allow strings in devicetree.cb
Duncan Laurie (dlaurie@google.com)
gerrit at coreboot.org
Thu May 12 23:29:08 CEST 2016
Duncan Laurie (dlaurie at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14787
-gerrit
commit f29e8e8a948d0987c6383895b78b3f2b9fa58d14
Author: Duncan Laurie <dlaurie at chromium.org>
Date: Sat May 7 19:43:25 2016 -0700
sconfig: Allow strings in devicetree.cb
Currently you cannot assign a string to a register in devicetree because
the quotes are removed when parsing and the literal is assigned directly.
Add a parse option for two double-quotation marks to indicate a string
and return a quoted literal that can be assigned to a register with a
'const char *' type.
Example:
chip drivers/i2c/generic
register "hid" = ""INT343B""
register "uid" = "1"
device i2c 15 on end
end
Change-Id: I621cde1f7547494a8035fbbab771f29522da1687
Signed-off-by: Duncan Laurie <dlaurie at chromium.org>
---
util/sconfig/sconfig.l | 1 +
1 file changed, 1 insertion(+)
diff --git a/util/sconfig/sconfig.l b/util/sconfig/sconfig.l
index dad574e..40fb164 100755
--- a/util/sconfig/sconfig.l
+++ b/util/sconfig/sconfig.l
@@ -49,6 +49,7 @@ end {return(END);}
[0-9.]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
[0-9a-fA-F.]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
INT[A-D] {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(PCIINT);}
+\"\"[^\"]+\"\" {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
\"[^\"]+\" {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
[^ \n\t]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
%%
More information about the coreboot-gerrit
mailing list