Add ifdtool, utility to read / modify Intel Firmware Descriptor images
[coreboot.git] / util / nvramtool / coreboot_tables.h
index d6e1b769425da9a54f64871891934b67792b28e7..22570ac1f63e8067f8b4df23163408c68ef12b37 100644 (file)
@@ -17,7 +17,7 @@
  * is expected to be information that cannot be discovered by
  * other means, such as quering the hardware directly.
  *
- * All of the information should be Position Independent Data.  
+ * All of the information should be Position Independent Data.
  * That is it should be safe to relocated any of the information
  * without it's meaning/correctnes changing.   For table that
  * can reasonably be used on multiple architectures the data
@@ -40,9 +40,9 @@
  * table entries and be backwards compatible, but it is not required.
  */
 
-/* Since coreboot is usually compiled 32bit, gcc will align 64bit 
- * types to 32bit boundaries. If the coreboot table is dumped on a 
- * 64bit system, a uint64_t would be aligned to 64bit boundaries, 
+/* Since coreboot is usually compiled 32bit, gcc will align 64bit
+ * types to 32bit boundaries. If the coreboot table is dumped on a
+ * 64bit system, a uint64_t would be aligned to 64bit boundaries,
  * breaking the table format.
  *
  * lb_uint64 will keep 64bit coreboot table values aligned to 32bit
@@ -74,7 +74,10 @@ static inline struct lb_uint64 pack_lb64(uint64_t value)
 }
 
 struct lb_header {
-       uint8_t signature[4];   /* LBIO */
+       union {
+               uint8_t signature[4];   /* LBIO */
+               uint32_t signature32;
+       };
        uint32_t header_bytes;
        uint32_t header_checksum;
        uint32_t table_bytes;
@@ -177,7 +180,7 @@ struct cmos_entries {
        uint32_t config;        /* e=enumeration, h=hex, r=reserved */
        uint32_t config_id;     /* a number linking to an enumeration record */
 #define CMOS_MAX_NAME_LENGTH 32
-       uint8_t name[CMOS_MAX_NAME_LENGTH];     /* name of entry in ascii, 
+       uint8_t name[CMOS_MAX_NAME_LENGTH];     /* name of entry in ascii,
                                                   variable length int aligned */
 };
 
@@ -192,7 +195,7 @@ struct cmos_enums {
        uint32_t config_id;     /* a number identifying the config id */
        uint32_t value;         /* the value associated with the text */
 #define CMOS_MAX_TEXT_LENGTH 32
-       uint8_t text[CMOS_MAX_TEXT_LENGTH];     /* enum description in ascii, 
+       uint8_t text[CMOS_MAX_TEXT_LENGTH];     /* enum description in ascii,
                                                   variable length int aligned */
 };