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