aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2009-05-09 17:14:58 +0000
committerRonald G. Minnich <rminnich@gmail.com>2009-05-09 17:14:58 +0000
commit442fc92b1f528902524412403f8c60ef4d0e1539 (patch)
tree7a3e5ccfe11cb7cd75e02789ef073d8c94d1ba20
parentb534e4256570ab100456837898c81aa581deeb09 (diff)
I would have liked to get an ack, but the error this corrects is pretty
critical, since unless it is fixed this tool creates empty tables that cause coreboot to (in some cases, e.g. on qemu) triple fault and die. For the record, an empty option_table is not allowed. The table must, at least, have 3 32-bit entries in this order: type -- should be 200, 0r 0xc8, i.e. 0xc8, 0, 0, 0 size of table in LE order, 4 bytes size of header in LE order, which is always 12,0,0,0 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4264 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r--util/options/build_opt_tbl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/options/build_opt_tbl.c b/util/options/build_opt_tbl.c
index f86090aeb4..075387d1d8 100644
--- a/util/options/build_opt_tbl.c
+++ b/util/options/build_opt_tbl.c
@@ -511,13 +511,13 @@ int main(int argc, char **argv)
}
/* write the array values */
for(i=0;i<(ct->size-1);i++) {
- if(!(i%10) && !err) err=fwrite("\n\t",1,2,fp);
+ if(!(i%10) && !err) err=!fwrite("\n\t",1,2,fp);
sprintf(buf,"0x%02x,",cmos_table[i]);
- if(!err) err=fwrite(buf,1,5,fp);
+ if(!err) err=!fwrite(buf,1,5,fp);
}
/* write the end */
sprintf(buf,"0x%02x\n",cmos_table[i]);
- if(!err) err=fwrite(buf,1,4,fp);
+ if(!err) err=!fwrite(buf,1,4,fp);
if(!fwrite("};\n",1,3,fp)) {
perror("Error - Could not write image file");
fclose(fp);