Author: oxygene
Date: 2009-08-17 17:19:52 +0200 (Mon, 17 Aug 2009)
New Revision: 4547

Modified:
   trunk/coreboot-v2/util/cbfstool/util.c
Log:
Move CBFS header to a safer place.

Signed-off-by: Thomas Jourdan <[email protected]>
Acked-by: Patrick Georgi <[email protected]>


Modified: trunk/coreboot-v2/util/cbfstool/util.c
===================================================================
--- trunk/coreboot-v2/util/cbfstool/util.c      2009-08-17 14:47:32 UTC (rev 
4546)
+++ trunk/coreboot-v2/util/cbfstool/util.c      2009-08-17 15:19:52 UTC (rev 
4547)
@@ -220,7 +220,7 @@
 
        /* This is a pointer to the header for easy access */
        rom->header = (struct cbfs_header *)
-           ROM_PTR(rom, rom->size - 16 - bootblocksize - sizeof(struct 
cbfs_header));
+           ROM_PTR(rom, rom->size - bootblocksize - sizeof(struct 
cbfs_header));
        rom->header->magic = htonl(HEADER_MAGIC);
        rom->header->romsize = htonl(romsize);
        rom->header->bootblocksize = htonl(bootblocksize);
@@ -233,7 +233,7 @@
        /* Write the cbfs master header address at the end of the ROM. */
 
        ROM_WRITEL(rom, rom->size - 4,
-                  0xFFFFFFF0 - bootblocksize - sizeof(struct cbfs_header));
+                  0xFFFFFFFF - bootblocksize - sizeof(struct cbfs_header) + 1);
 
        /* write the empty header */
        rom_set_header(rom, (struct cbfs_file *)rom->ptr, "", -1, 
CBFS_COMPONENT_NULL);


-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to