[coreboot] [v2] r4264 - trunk/coreboot-v2/util/options

svn at coreboot.org svn at coreboot.org
Sat May 9 19:14:58 CEST 2009


Author: rminnich
Date: 2009-05-09 19:14:58 +0200 (Sat, 09 May 2009)
New Revision: 4264

Modified:
   trunk/coreboot-v2/util/options/build_opt_tbl.c
Log:
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 at gmail.com>
Acked-by: Ronald G. Minnich <rminnich at gmail.com>



Modified: trunk/coreboot-v2/util/options/build_opt_tbl.c
===================================================================
--- trunk/coreboot-v2/util/options/build_opt_tbl.c	2009-05-08 20:07:00 UTC (rev 4263)
+++ trunk/coreboot-v2/util/options/build_opt_tbl.c	2009-05-09 17:14:58 UTC (rev 4264)
@@ -511,13 +511,13 @@
         	}
 		/* 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);





More information about the coreboot mailing list