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