From 442fc92b1f528902524412403f8c60ef4d0e1539 Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Sat, 9 May 2009 17:14:58 +0000 Subject: [PATCH] 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 Acked-by: Ronald G. Minnich git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4264 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/options/build_opt_tbl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/options/build_opt_tbl.c b/util/options/build_opt_tbl.c index f86090aeb..075387d1d 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); -- 2.25.1