TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmVariableCommon.h
Go to the documentation of this file.
1
9#ifndef _SMM_VARIABLE_COMMON_H_
10#define _SMM_VARIABLE_COMMON_H_
11
12#include <Guid/VariableFormat.h>
13#include <Protocol/VarCheck.h>
14
15#define EFI_SMM_VARIABLE_WRITE_GUID \
16 { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 } }
17
18extern EFI_GUID gSmmVariableWriteGuid;
19
20//
21// This structure is used for SMM variable. the collected statistics data is saved in SMRAM. It can be got from
22// SMI handler. The communication buffer should be:
23// EFI_MM_COMMUNICATE_HEADER + SMM_VARIABLE_COMMUNICATE_HEADER + payload.
24//
25typedef struct {
26 UINTN Function;
27 EFI_STATUS ReturnStatus;
28 UINT8 Data[1];
30
31//
32// The payload for this function is SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE.
33//
34#define SMM_VARIABLE_FUNCTION_GET_VARIABLE 1
35//
36// The payload for this function is SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME.
37//
38#define SMM_VARIABLE_FUNCTION_GET_NEXT_VARIABLE_NAME 2
39//
40// The payload for this function is SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE.
41//
42#define SMM_VARIABLE_FUNCTION_SET_VARIABLE 3
43//
44// The payload for this function is SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO.
45//
46#define SMM_VARIABLE_FUNCTION_QUERY_VARIABLE_INFO 4
47//
48// It is a notify event, no extra payload for this function.
49//
50#define SMM_VARIABLE_FUNCTION_READY_TO_BOOT 5
51//
52// It is a notify event, no extra payload for this function.
53//
54#define SMM_VARIABLE_FUNCTION_EXIT_BOOT_SERVICE 6
55//
56// The payload for this function is VARIABLE_INFO_ENTRY. The GUID in EFI_MM_COMMUNICATE_HEADER
57// is gEfiSmmVariableProtocolGuid.
58//
59#define SMM_VARIABLE_FUNCTION_GET_STATISTICS 7
60//
61// The payload for this function is SMM_VARIABLE_COMMUNICATE_LOCK_VARIABLE
62//
63#define SMM_VARIABLE_FUNCTION_LOCK_VARIABLE 8
64
65#define SMM_VARIABLE_FUNCTION_VAR_CHECK_VARIABLE_PROPERTY_SET 9
66
67#define SMM_VARIABLE_FUNCTION_VAR_CHECK_VARIABLE_PROPERTY_GET 10
68
69#define SMM_VARIABLE_FUNCTION_GET_PAYLOAD_SIZE 11
70//
71// The payload for this function is SMM_VARIABLE_COMMUNICATE_RUNTIME_VARIABLE_CACHE_CONTEXT
72//
73#define SMM_VARIABLE_FUNCTION_INIT_RUNTIME_VARIABLE_CACHE_CONTEXT 12
74
75#define SMM_VARIABLE_FUNCTION_SYNC_RUNTIME_CACHE 13
76//
77// The payload for this function is SMM_VARIABLE_COMMUNICATE_GET_RUNTIME_CACHE_INFO
78//
79#define SMM_VARIABLE_FUNCTION_GET_RUNTIME_CACHE_INFO 14
80
84#define SMM_COMMUNICATE_HEADER_SIZE (OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data))
85
89#define SMM_VARIABLE_COMMUNICATE_HEADER_SIZE (OFFSET_OF (SMM_VARIABLE_COMMUNICATE_HEADER, Data))
90
94typedef struct {
95 EFI_GUID Guid;
96 UINTN DataSize;
97 UINTN NameSize;
98 UINT32 Attributes;
99 CHAR16 Name[1];
101
105typedef struct {
106 EFI_GUID Guid;
107 UINTN NameSize; // Return name buffer size
108 CHAR16 Name[1];
110
114typedef struct {
115 UINT64 MaximumVariableStorageSize;
116 UINT64 RemainingVariableStorageSize;
117 UINT64 MaximumVariableSize;
118 UINT32 Attributes;
120
122
123typedef struct {
124 EFI_GUID Guid;
125 UINTN NameSize;
126 VAR_CHECK_VARIABLE_PROPERTY VariableProperty;
127 CHAR16 Name[1];
129
130typedef struct {
131 UINTN VariablePayloadSize;
133
134typedef struct {
135 BOOLEAN *ReadLock;
136 BOOLEAN *PendingUpdate;
137 BOOLEAN *HobFlushComplete;
138 VARIABLE_STORE_HEADER *RuntimeHobCache;
139 VARIABLE_STORE_HEADER *RuntimeNvCache;
140 VARIABLE_STORE_HEADER *RuntimeVolatileCache;
142
143typedef struct {
144 UINTN TotalHobStorageSize;
145 UINTN TotalNvStorageSize;
146 UINTN TotalVolatileStorageSize;
147 BOOLEAN AuthenticatedVariableUsage;
149
150#endif // _SMM_VARIABLE_COMMON_H_
UINT64 UINTN
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213