]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/VariableFormat.h
2 The variable data structures are related to EDK II specific UEFI variable implementation.
3 Variable data header and Variable storage region header are defined here.
5 Copyright (c) 2006 - 2008 Intel Corporation. <BR>
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __VARIABLE_FORMAT_H__
17 #define __VARIABLE_FORMAT_H__
20 /// Alignment of variable name and data.
21 /// For IA32/X64 architecture, the alignment is set to 1, and 8 is for IPF archtecture.
23 #if defined (MDE_CPU_IPF)
30 // GET_PAD_SIZE to calculate miminal pad bytes to make current size satisfy the alignment requirement
32 #if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
33 #define GET_PAD_SIZE(a) (0)
35 #define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
39 /// Alignment of Variable Data Header in Variable Store region
41 #define HEADER_ALIGNMENT 4
42 #define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
45 /// Status of Variable Store Region
52 } VARIABLE_STORE_STATUS
;
56 #define VARIABLE_STORE_SIGNATURE SIGNATURE_32 ('$', 'V', 'S', 'S')
59 /// Variable Store Header Format and State
61 #define VARIABLE_STORE_FORMATTED 0x5a
62 #define VARIABLE_STORE_HEALTHY 0xfe
65 /// Variable Store region header
69 /// Variable store region signature.
73 /// Size of variable store region including this header
77 /// variable region format state
81 /// variable region healthy state
86 } VARIABLE_STORE_HEADER
;
89 /// Variable data start flag
91 #define VARIABLE_DATA 0x55AA
94 /// Variable State flags
96 #define VAR_IN_DELETED_TRANSITION 0xfe ///< Variable is in obsolete transistion
97 #define VAR_DELETED 0xfd ///< Variable is obsolete
98 #define VAR_HEADER_VALID_ONLY 0x7f ///< Variable header has been valid
99 #define VAR_ADDED 0x3f ///< Variable has been completely added
102 /// Single Variable Data Header Structure
106 /// Variable Data Start Flag
110 /// Variable State defined above
115 /// Attributes of variable defined in UEFI spec
119 /// Size of variable Null-terminated Unicode string name
123 /// Size of the variable data without this header
127 /// A unique identifier for the vendor that produce and consume this varaible.
134 #endif // _EFI_VARIABLE_H_