2 The file defined some common structures used for communicating between SMM variable module and SMM variable wrapper module.
4 Copyright (c) 2011 - 2013, 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.
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.
15 #ifndef _SMM_VARIABLE_COMMON_H_
16 #define _SMM_VARIABLE_COMMON_H_
18 #define EFI_SMM_VARIABLE_WRITE_GUID \
19 { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 } }
21 extern EFI_GUID gSmmVariableWriteGuid
;
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.
30 EFI_STATUS ReturnStatus
;
32 } SMM_VARIABLE_COMMUNICATE_HEADER
;
35 // The payload for this function is SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE.
37 #define SMM_VARIABLE_FUNCTION_GET_VARIABLE 1
39 // The payload for this function is SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME.
41 #define SMM_VARIABLE_FUNCTION_GET_NEXT_VARIABLE_NAME 2
43 // The payload for this function is SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE.
45 #define SMM_VARIABLE_FUNCTION_SET_VARIABLE 3
47 // The payload for this function is SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO.
49 #define SMM_VARIABLE_FUNCTION_QUERY_VARIABLE_INFO 4
51 // It is a notify event, no extra payload for this function.
53 #define SMM_VARIABLE_FUNCTION_READY_TO_BOOT 5
55 // It is a notify event, no extra payload for this function.
57 #define SMM_VARIABLE_FUNCTION_EXIT_BOOT_SERVICE 6
59 // The payload for this function is VARIABLE_INFO_ENTRY. The GUID in EFI_SMM_COMMUNICATE_HEADER
60 // is gEfiSmmVariableProtocolGuid.
62 #define SMM_VARIABLE_FUNCTION_GET_STATISTICS 7
64 // The payload for this function is SMM_VARIABLE_COMMUNICATE_LOCK_VARIABLE
66 #define SMM_VARIABLE_FUNCTION_LOCK_VARIABLE 8
69 /// Size of SMM communicate header, without including the payload.
71 #define SMM_COMMUNICATE_HEADER_SIZE (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data))
74 /// Size of SMM variable communicate header, without including the payload.
76 #define SMM_VARIABLE_COMMUNICATE_HEADER_SIZE (OFFSET_OF (SMM_VARIABLE_COMMUNICATE_HEADER, Data))
79 /// This structure is used to communicate with SMI handler by SetVariable and GetVariable.
87 } SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE
;
90 /// This structure is used to communicate with SMI handler by GetNextVariableName.
94 UINTN NameSize
; // Return name buffer size
96 } SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME
;
99 /// This structure is used to communicate with SMI handler by QueryVariableInfo.
102 UINT64 MaximumVariableStorageSize
;
103 UINT64 RemainingVariableStorageSize
;
104 UINT64 MaximumVariableSize
;
106 } SMM_VARIABLE_COMMUNICATE_QUERY_VARIABLE_INFO
;
108 typedef SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME SMM_VARIABLE_COMMUNICATE_LOCK_VARIABLE
;
110 #endif // _SMM_VARIABLE_COMMON_H_