[coreboot] New patch to review for coreboot: 1c862b0 Change "VERSION*" to more determined name "CBFS_HEADER_VERSION*".

Hung-Te Lin (hungte@chromium.org) gerrit at coreboot.org
Fri Jan 4 05:36:27 CET 2013


Hung-Te Lin (hungte at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2098

-gerrit

commit 1c862b03e4f8602090679001ee18a684f16fec37
Author: Hung-Te Lin <hungte at chromium.org>
Date:   Fri Jan 4 12:33:03 2013 +0800

    Change "VERSION*" to more determined name "CBFS_HEADER_VERSION*".
    
    The 'VERSION' in CBFS header file is confusing and may conflict when being used
    in libpayload.
    
    Change-Id: I24cce0cd73540e38d96f222df0a65414b16f6260
    Signed-off-by: Hung-Te Lin <hungte at chromium.org>
---
 payloads/libpayload/include/cbfs_core.h | 6 +++---
 src/include/cbfs_core.h                 | 6 +++---
 util/cbfstool/cbfs.h                    | 6 +++---
 util/cbfstool/common.c                  | 6 +++---
 util/nvramtool/cbfs.h                   | 2 +-
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/payloads/libpayload/include/cbfs_core.h b/payloads/libpayload/include/cbfs_core.h
index 9a21a78..a3c54b1 100644
--- a/payloads/libpayload/include/cbfs_core.h
+++ b/payloads/libpayload/include/cbfs_core.h
@@ -88,9 +88,9 @@
 /* FIXME: This could also be 0xFFFF0000 with HIVECS enabled */
 #define CBFS_HEADPTR_ADDR 0x0000000C
 #endif
-#define VERSION1 0x31313131
-#define VERSION2 0x31313132
-#define VERSION  VERSION2
+#define CBFS_HEADER_VERSION1 0x31313131
+#define CBFS_HEADER_VERSION2 0x31313132
+#define CBFS_HEADER_VERSION  CBFS_HEADER_VERSION2
 
 struct cbfs_header {
 	uint32_t magic;
diff --git a/src/include/cbfs_core.h b/src/include/cbfs_core.h
index 9a21a78..a3c54b1 100644
--- a/src/include/cbfs_core.h
+++ b/src/include/cbfs_core.h
@@ -88,9 +88,9 @@
 /* FIXME: This could also be 0xFFFF0000 with HIVECS enabled */
 #define CBFS_HEADPTR_ADDR 0x0000000C
 #endif
-#define VERSION1 0x31313131
-#define VERSION2 0x31313132
-#define VERSION  VERSION2
+#define CBFS_HEADER_VERSION1 0x31313131
+#define CBFS_HEADER_VERSION2 0x31313132
+#define CBFS_HEADER_VERSION  CBFS_HEADER_VERSION2
 
 struct cbfs_header {
 	uint32_t magic;
diff --git a/util/cbfstool/cbfs.h b/util/cbfstool/cbfs.h
index 5251d65..617eeee 100644
--- a/util/cbfstool/cbfs.h
+++ b/util/cbfstool/cbfs.h
@@ -23,9 +23,9 @@
 
 #define CBFS_HEADER_MAGIC  0x4F524243
 #define CBFS_HEADPTR_ADDR_X86 0xFFFFFFFC
-#define VERSION1 0x31313131
-#define VERSION2 0x31313132
-#define VERSION  VERSION2
+#define CBFS_HEADER_VERSION1 0x31313131
+#define CBFS_HEADER_VERSION2 0x31313132
+#define CBFS_HEADER_VERSION  CBFS_HEADER_VERSION2
 
 struct cbfs_header {
 	uint32_t magic;
diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c
index befdc3f..3b63e54 100644
--- a/util/cbfstool/common.c
+++ b/util/cbfstool/common.c
@@ -143,7 +143,7 @@ void recalculate_rom_geometry(void *romarea)
 	}
 
 	/* Update old headers */
-	if (master_header->version == VERSION1 &&
+	if (master_header->version == CBFS_HEADER_VERSION1 &&
 	    ntohl(master_header->architecture) == CBFS_ARCHITECTURE_UNKNOWN) {
 		dprintf("Updating CBFS master header to version 2\n");
 		master_header->architecture = htonl(CBFS_ARCHITECTURE_X86);
@@ -583,7 +583,7 @@ int create_cbfs_image(const char *romfile, uint32_t _romsize,
 		arm_vec[0] = htonl(0x0e0000ea);  // branch to . + 64 bytes
 
 		master_header->magic = ntohl(CBFS_HEADER_MAGIC);
-		master_header->version = ntohl(VERSION);
+		master_header->version = ntohl(CBFS_HEADER_VERSION);
 		master_header->romsize = htonl(romsize);
 		master_header->bootblocksize = htonl(bootblocksize);
 		master_header->align = htonl(align);
@@ -612,7 +612,7 @@ int create_cbfs_image(const char *romfile, uint32_t _romsize,
 				  bootblocksize - sizeof(struct cbfs_header));
 
 		master_header->magic = ntohl(CBFS_HEADER_MAGIC);
-		master_header->version = ntohl(VERSION);
+		master_header->version = ntohl(CBFS_HEADER_VERSION);
 		master_header->romsize = htonl(romsize);
 		master_header->bootblocksize = htonl(bootblocksize);
 		master_header->align = htonl(align);
diff --git a/util/nvramtool/cbfs.h b/util/nvramtool/cbfs.h
index 5f9db8d..bf5ca95 100644
--- a/util/nvramtool/cbfs.h
+++ b/util/nvramtool/cbfs.h
@@ -89,7 +89,7 @@ typedef uint8_t u8;
 
 #define CBFS_HEADER_MAGIC  0x4F524243
 #define CBFS_HEADPTR_ADDR 0xFFFFFFFc
-#define VERSION1 0x31313131
+#define CBFS_HEADER_VERSION1 0x31313131
 
 struct cbfs_header {
 	u32 magic;



More information about the coreboot mailing list