From 0cfd87938b4e27a52572934ff6d85bc484a87f73 Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Thu, 19 Oct 2006 23:17:43 +0000 Subject: [PATCH] fix up initialisation. can an IBM person please take this back to IBM and see if the -O lb produces structs that are in the least sensible? signed-off-by: Ronald G. minnich git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@30 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- util/dtc/dtc.h | 2 +- util/dtc/flattree.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/util/dtc/dtc.h b/util/dtc/dtc.h index 7366504eef..188c45ab21 100644 --- a/util/dtc/dtc.h +++ b/util/dtc/dtc.h @@ -101,7 +101,7 @@ struct fixup { struct data { int len; - char *val; + unsigned char *val; int asize; struct fixup *refs; }; diff --git a/util/dtc/flattree.c b/util/dtc/flattree.c index 3f2ee09d4d..25cac37025 100644 --- a/util/dtc/flattree.c +++ b/util/dtc/flattree.c @@ -413,7 +413,7 @@ static void linuxbios_emit_data(void *e, struct property *p) return; cleanname = clean(p->name, 1); - fprintf(f, "\tu8 %s = {", cleanname); + fprintf(f, "\t.%s = {", cleanname); free(cleanname); for(i = 0; i < d.len; i++) @@ -539,13 +539,13 @@ static void flatten_tree_emit_structdecls(struct node *tree, struct emitter *emi if (streq(prop->name, "name")) seen_name_prop = 1; cleanname = clean(prop->name, 0); - fprintf(f, "\tu32 %s;\n", cleanname); + fprintf(f, "\tu8 %s[%d];\n", prop->name, prop->val.len); free(cleanname); } #if 0 if ((vi->flags & FTF_NAMEPROPS) && !seen_name_prop) { - fprintf(f, "\tu32 %s\n", prop->name); + fprintf(f, "\tu8 %s[%d];\n", prop->name, prop->val.len); } #endif emit->endnode(etarget, treename); @@ -590,7 +590,7 @@ static void flatten_tree_emit_structinits(struct node *tree, struct emitter *emi } #if 0 if ((vi->flags & FTF_NAMEPROPS) && !seen_name_prop) { - fprintf(f, "\tu32 %s\n", prop->name); + fprintf(f, "\tu8 %s[%d]\n", prop->name, prop->data.len); } #endif