X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FInclude%2FVariableFormat.h;h=6e4ad1a9ca6ce7a638166499a54da90a928e5c5b;hp=4796c49afc80076c6517fb05672a5bec7ef8020c;hb=e56187913724379012649c0411668f94ac2ffd9f;hpb=346cf9ace3b51e3d40019ce7f6fee24375f829cc diff --git a/MdeModulePkg/Include/VariableFormat.h b/MdeModulePkg/Include/VariableFormat.h index 4796c49afc..6e4ad1a9ca 100644 --- a/MdeModulePkg/Include/VariableFormat.h +++ b/MdeModulePkg/Include/VariableFormat.h @@ -1,5 +1,6 @@ /** @file - The variable data structure related to EDK II specific UEFI variable implementation. + The variable data structures are related to EDK II specific UEFI variable implementation. + Variable data header and Variable storage region header are defined here. Copyright (c) 2006 - 2008 Intel Corporation.
All rights reserved. This program and the accompanying materials @@ -16,23 +17,8 @@ #define __VARIABLE_FORMAT_H__ /// -/// Maximum buffer for the single variable. -/// -#ifndef MAX_VARIABLE_SIZE -#define MAX_VARIABLE_SIZE FixedPcdGet32(PcdMaxVariableSize) -#endif - -/// -/// Maximum buffer for Hardware error record variable -/// -#ifndef MAX_HARDWARE_ERROR_VARIABLE_SIZE -#define MAX_HARDWARE_ERROR_VARIABLE_SIZE FixedPcdGet32(PcdMaxHardwareErrorVariableSize) -#endif - -/// -/// The alignment of variable's start offset. -/// For IA32/X64 architecture, the alignment is set to 1, and -/// 8 is for IPF archtecture. +/// Alignment of variable name and data. +/// For IA32/X64 architecture, the alignment is set to 1, and 8 is for IPF archtecture. /// #if defined (MDE_CPU_IPF) #define ALIGNMENT 8 @@ -40,10 +26,23 @@ #define ALIGNMENT 1 #endif +// +// Define GET_PAD_SIZE to optimize compiler +// +#if ((ALIGNMENT == 0) || (ALIGNMENT == 1)) +#define GET_PAD_SIZE(a) (0) +#else +#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1)) +#endif + +/// +/// Alignment of Variable Data Header in Variable Store region +/// #define HEADER_ALIGNMENT 4 +#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1))) /// -/// Variable Store Status +/// Status of Variable Store Region /// typedef enum { EfiRaw, @@ -54,7 +53,7 @@ typedef enum { #pragma pack(1) -#define VARIABLE_STORE_SIGNATURE EFI_SIGNATURE_32 ('$', 'V', 'S', 'S') +#define VARIABLE_STORE_SIGNATURE SIGNATURE_32 ('$', 'V', 'S', 'S') /// /// Variable Store Header Format and State @@ -94,18 +93,13 @@ typedef struct { /// /// Variable State flags /// -#define VAR_IN_DELETED_TRANSITION 0xfe /// Variable is in obsolete transistion -#define VAR_DELETED 0xfd /// Variable is obsolete -#define VAR_HEADER_VALID_ONLY 0x7f /// Variable header has been valid -#define VAR_ADDED 0x3f /// Variable has been completely added - -/// -/// Removed -/// -#define IS_VARIABLE_STATE(_c, _Mask) (BOOLEAN) (((~_c) & (~_Mask)) != 0) +#define VAR_IN_DELETED_TRANSITION 0xfe ///< Variable is in obsolete transistion +#define VAR_DELETED 0xfd ///< Variable is obsolete +#define VAR_HEADER_VALID_ONLY 0x7f ///< Variable header has been valid +#define VAR_ADDED 0x3f ///< Variable has been completely added /// -/// Variable Data Header Structure +/// Single Variable Data Header Structure /// typedef struct { /// @@ -130,7 +124,7 @@ typedef struct { /// UINT32 DataSize; /// - /// A unique identifier for the vendor. + /// A unique identifier for the vendor that produce and consume this varaible. /// EFI_GUID VendorGuid; } VARIABLE_HEADER;