Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(641)

Unified Diff: firmware/lib/cgptlib/include/gpt.h

Issue 2865014: Assorted integration fixes. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Add struct size tests Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/include/sysincludes.h ('k') | firmware/lib/include/vboot_struct.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/cgptlib/include/gpt.h
diff --git a/firmware/lib/cgptlib/include/gpt.h b/firmware/lib/cgptlib/include/gpt.h
index cd5e12b9b7a5865d145a0cddf1b8212e8d11fe72..79cc8b2b0d454bc4dd73afbcdf5ab186bf830c08 100644
--- a/firmware/lib/cgptlib/include/gpt.h
+++ b/firmware/lib/cgptlib/include/gpt.h
@@ -12,6 +12,8 @@
#include "sysincludes.h"
+PACK_START /* Support packing for MSVC */
+
#define GPT_HEADER_SIGNATURE "EFI PART"
#define GPT_HEADER_SIGNATURE_SIZE sizeof(GPT_HEADER_SIGNATURE)
#define GPT_HEADER_REVISION 0x00010000
@@ -58,6 +60,8 @@ typedef struct {
} u;
} __attribute__((packed)) Guid;
+#define GUID_EXPECTED_SIZE GUID_SIZE
+
/* Some constant values */
extern const Guid guid_unused;
extern const Guid guid_chromeos_kernel;
@@ -86,6 +90,8 @@ typedef struct {
/* Remainder of sector is reserved and should be 0 */
} __attribute__((packed)) GptHeader;
+#define GPTHEADER_EXPECTED_SIZE 92
+
/* GPT partition entry defines the starting and ending LBAs of a partition.
* It also contains the unique GUID, type, and attribute bits.
*
@@ -98,8 +104,8 @@ typedef struct {
uint64_t ending_lba;
union {
struct {
- uint64_t : 48;
- uint16_t gpt_att : 16;
+ uint16_t reserved[3];
+ uint16_t gpt_att;
} __attribute__((packed)) fields;
uint64_t whole;
} attrs;
@@ -107,4 +113,8 @@ typedef struct {
/* Remainder of entry is reserved and should be 0 */
} __attribute__((packed)) GptEntry;
+#define GPTENTRY_EXPECTED_SIZE 128
+
+PACK_STOP /* Support packing for MSVC */
+
#endif /* VBOOT_REFERENCE_CGPTLIB_GPT_H_ */
« no previous file with comments | « firmware/include/sysincludes.h ('k') | firmware/lib/include/vboot_struct.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698