]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/VariableFormat.h
Add INF extension Information
[mirror_edk2.git] / MdeModulePkg / Include / VariableFormat.h
index 7c0bf1a3eb1188c71c4b80530e188cfc9c847bf1..6e4ad1a9ca6ce7a638166499a54da90a928e5c5b 100644 (file)
@@ -1,5 +1,6 @@
 /** @file\r
-  The variable data structure related to EDK II specific UEFI variable implementation.\r
+  The variable data structures are related to EDK II specific UEFI variable implementation.\r
+  Variable data header and Variable storage region header are defined here.\r
 \r
   Copyright (c) 2006 - 2008 Intel Corporation. <BR>\r
   All rights reserved. This program and the accompanying materials\r
 #define __VARIABLE_FORMAT_H__\r
 \r
 ///\r
-/// Maximum buffer for the single variable.\r
-///\r
-#ifndef MAX_VARIABLE_SIZE\r
-#define MAX_VARIABLE_SIZE                 FixedPcdGet32(PcdMaxVariableSize)\r
-#endif\r
-\r
-///\r
-/// Maximum buffer for Hardware error record variable\r
-///\r
-#ifndef MAX_HARDWARE_ERROR_VARIABLE_SIZE\r
-#define MAX_HARDWARE_ERROR_VARIABLE_SIZE  FixedPcdGet32(PcdMaxHardwareErrorVariableSize)\r
-#endif\r
-\r
-///\r
-/// The alignment of variable's start offset.\r
-/// For IA32/X64 architecture, the alignment is set to 1, and\r
-/// 8 is for IPF archtecture.\r
+/// Alignment of variable name and data.\r
+/// For IA32/X64 architecture, the alignment is set to 1, and 8 is for IPF archtecture.\r
 ///\r
 #if defined (MDE_CPU_IPF)\r
 #define ALIGNMENT         8\r
 #define ALIGNMENT         1\r
 #endif\r
 \r
+//\r
+// Define GET_PAD_SIZE to optimize compiler\r
+//\r
+#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))\r
+#define GET_PAD_SIZE(a) (0)\r
+#else\r
+#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))\r
+#endif\r
+\r
+///\r
+/// Alignment of Variable Data Header in Variable Store region\r
+///\r
 #define HEADER_ALIGNMENT  4\r
+#define HEADER_ALIGN(Header)  (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))\r
 \r
 ///\r
-/// Variable Store Status\r
+/// Status of Variable Store Region\r
 ///\r
 typedef enum {\r
   EfiRaw,\r
@@ -100,12 +99,7 @@ typedef struct {
 #define VAR_ADDED                     0x3f  ///< Variable has been completely added\r
 \r
 ///\r
-/// Removed\r
-///\r
-#define IS_VARIABLE_STATE(_c, _Mask)  (BOOLEAN) (((~_c) & (~_Mask)) != 0)\r
-\r
-///\r
-/// Variable Data Header Structure\r
+/// Single Variable Data Header Structure\r
 ///\r
 typedef struct {\r
   ///\r
@@ -130,7 +124,7 @@ typedef struct {
   ///\r
   UINT32      DataSize;\r
   ///\r
-  /// A unique identifier for the vendor.\r
+  /// A unique identifier for the vendor that produce and consume this varaible.\r
   ///\r
   EFI_GUID    VendorGuid;\r
 } VARIABLE_HEADER;\r