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