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
}
/* write the array values */
for(i=0;i<(ct->size-1);i++) {
}
/* 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]);
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]);
}
/* 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);
if(!fwrite("};\n",1,3,fp)) {
perror("Error - Could not write image file");
fclose(fp);