]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Guid/SmmVariableCommon.h
Patch from open source community for CryptoPkg to allow it to build for ARM using...
[mirror_edk2.git] / MdeModulePkg / Include / Guid / SmmVariableCommon.h
CommitLineData
d00ed85e 1/** @file\r
2 The file defined some common structures used for communicating between SMM variable module and SMM variable wrapper module.\r
3\r
4Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials are licensed and made available under \r
6the terms and conditions of the BSD License that accompanies this distribution. \r
7The 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
13**/\r
14\r
15#ifndef _SMM_VARIABLE_COMMON_H_\r
16#define _SMM_VARIABLE_COMMON_H_\r
17\r
18#define EFI_SMM_VARIABLE_WRITE_GUID \\r
19 { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 } }\r
20\r
21extern EFI_GUID gSmmVariableWriteGuid;\r
22\r
23//\r
24// This structure is used for SMM variable. the collected statistics data is saved in SMRAM. It can be got from \r
25// SMI handler. The communication buffer should be: \r
26// EFI_SMM_COMMUNICATE_HEADER + SMM_VARIABLE_COMMUNICATE_HEADER + payload.\r
27//\r
28typedef struct {\r
29 UINTN Function;\r
30 EFI_STATUS ReturnStatus;\r
31 UINT8 Data[1];\r
32} SMM_VARIABLE_COMMUNICATE_HEADER;\r
33\r
34//\r
35// The payload for this function is SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE.\r
36//\r
37#define SMM_VARIABLE_FUNCTION_GET_VARIABLE 1\r
38//\r
39// The payload for this function is SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME.\r
40// \r
41#define SMM_VARIABLE_FUNCTION_GET_NEXT_VARIABLE_NAME 2\r
42//\r
43// The payload for this function is SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE.\r
44// \r
45#define SMM_VARIABLE_FUNCTION_SET_VARIABLE 3\r
46//\r
47// The payload for this function is SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO.\r
48// \r
49#define SMM_VARIABLE_FUNCTION_QUERY_VARIABLE_INFO 4\r
50//\r
51// It is a notify event, no extra payload for this function.\r
52// \r
53#define SMM_VARIABLE_FUNCTION_READY_TO_BOOT 5\r
54//\r
55// It is a notify event, no extra payload for this function.\r
56// \r
57#define SMM_VARIABLE_FUNCTION_EXIT_BOOT_SERVICE 6\r
58//\r
59// The payload for this function is VARIABLE_INFO_ENTRY. The GUID in EFI_SMM_COMMUNICATE_HEADER \r
60// is gEfiSmmVariableProtocolGuid.\r
61//\r
62#define SMM_VARIABLE_FUNCTION_GET_STATISTICS 7\r
63\r
64///\r
65/// Size of SMM communicate header, without including the payload.\r
66///\r
67#define SMM_COMMUNICATE_HEADER_SIZE (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data))\r
68\r
69///\r
70/// Size of SMM variable communicate header, without including the payload.\r
71///\r
72#define SMM_VARIABLE_COMMUNICATE_HEADER_SIZE (OFFSET_OF (SMM_VARIABLE_COMMUNICATE_HEADER, Data))\r
73\r
74///\r
75/// This structure is used to communicate with SMI handler by SetVariable and GetVariable.\r
76///\r
77typedef struct {\r
78 EFI_GUID Guid;\r
79 UINTN DataSize;\r
80 UINTN NameSize;\r
81 UINT32 Attributes; \r
82 CHAR16 Name[1];\r
83} SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE;\r
84\r
85///\r
86/// This structure is used to communicate with SMI handler by GetNextVariableName.\r
87///\r
88typedef struct {\r
89 EFI_GUID Guid;\r
90 UINTN NameSize;\r
91 CHAR16 Name[1];\r
92} SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME;\r
93\r
94///\r
95/// This structure is used to communicate with SMI handler by QueryVariableInfo.\r
96///\r
97typedef struct {\r
98 UINT64 MaximumVariableStorageSize;\r
99 UINT64 RemainingVariableStorageSize;\r
100 UINT64 MaximumVariableSize;\r
101 UINT32 Attributes; \r
102} SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO;\r
103\r
104#endif // _SMM_VARIABLE_COMMON_H_