MdePkg:
[mirror_edk2.git] / EdkModulePkg / Include / Common / Variable.h
CommitLineData
20798fc5 1/**@file\r
2 Header file for EFI Variable Services.\r
3 \r
4Copyright (c) 2006 - 2007 Intel Corporation. <BR>\r
878ddf1f 5All rights reserved. This program and the accompanying materials \r
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
20798fc5 13**/\r
878ddf1f 14\r
15#ifndef _EFI_VARIABLE_H_\r
16#define _EFI_VARIABLE_H_\r
17\r
18#define VARIABLE_STORE_SIGNATURE EFI_SIGNATURE_32 ('$', 'V', 'S', 'S')\r
19\r
06fb8ffd 20#define MAX_VARIABLE_SIZE 1024\r
878ddf1f 21\r
06fb8ffd 22//\r
23// Enlarges the hardware error record maximum variable size to 32K bytes\r
24//\r
25#define MAX_HARDWARE_ERROR_VARIABLE_SIZE 0x8000\r
26\r
27#define VARIABLE_DATA 0x55AA\r
878ddf1f 28\r
29//\r
30// Variable Store Header flags\r
31//\r
06fb8ffd 32#define VARIABLE_STORE_FORMATTED 0x5a\r
33#define VARIABLE_STORE_HEALTHY 0xfe\r
878ddf1f 34\r
20798fc5 35//\r
36// The alignment of variable's start offset.\r
72c11e3a 37// For IA32/X64 architecture, the alignment is set to 1, and \r
39d03acf 38// 8 is for IPF archtecture.\r
20798fc5 39//\r
40#if defined (MDE_CPU_IPF)\r
41#define ALIGNMENT 8\r
42#else\r
72c11e3a 43#define ALIGNMENT 1\r
20798fc5 44#endif\r
45\r
878ddf1f 46//\r
47// Variable Store Status\r
48//\r
49typedef enum {\r
50 EfiRaw,\r
51 EfiValid,\r
52 EfiInvalid,\r
53 EfiUnknown\r
54} VARIABLE_STORE_STATUS;\r
55\r
56//\r
57// Variable State flags\r
58//\r
59#define VAR_IN_DELETED_TRANSITION 0xfe // Variable is in obsolete transistion\r
60#define VAR_DELETED 0xfd // Variable is obsolete\r
61#define VAR_ADDED 0x7f // Variable has been completely added\r
62#define IS_VARIABLE_STATE(_c, _Mask) (BOOLEAN) (((~_c) & (~_Mask)) != 0)\r
63\r
64#pragma pack(1)\r
65\r
66typedef struct {\r
67 UINT32 Signature;\r
68 UINT32 Size;\r
69 UINT8 Format;\r
70 UINT8 State;\r
71 UINT16 Reserved;\r
72 UINT32 Reserved1;\r
73} VARIABLE_STORE_HEADER;\r
74\r
75typedef struct {\r
76 UINT16 StartId;\r
77 UINT8 State;\r
78 UINT8 Reserved;\r
79 UINT32 Attributes;\r
80 UINT32 NameSize;\r
81 UINT32 DataSize;\r
82 EFI_GUID VendorGuid;\r
83} VARIABLE_HEADER;\r
84\r
85#pragma pack()\r
86\r
87#endif // _EFI_VARIABLE_H_\r