]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/SmmBase2.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / SmmBase2.h
CommitLineData
2a452a56 1/** @file\r
2 EFI SMM Base2 Protocol as defined in the PI 1.2 specification.\r
3\r
4 This protocol is utilized by all SMM drivers to locate the SMM infrastructure services and determine\r
5 whether the driver is being invoked inside SMRAM or outside of SMRAM.\r
6\r
9095d37b 7 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
2a452a56 9\r
10**/\r
11\r
12#ifndef _SMM_BASE2_H_\r
13#define _SMM_BASE2_H_\r
14\r
15#include <Pi/PiSmmCis.h>\r
2f208e59 16#include <Protocol/MmBase.h>\r
2a452a56 17\r
2f208e59 18#define EFI_SMM_BASE2_PROTOCOL_GUID EFI_MM_BASE_PROTOCOL_GUID\r
2a452a56 19\r
20typedef struct _EFI_SMM_BASE2_PROTOCOL EFI_SMM_BASE2_PROTOCOL;\r
21\r
22/**\r
23 Service to indicate whether the driver is currently executing in the SMM Initialization phase.\r
9095d37b
LG
24\r
25 This service is used to indicate whether the driver is currently executing in the SMM Initialization\r
26 phase. For SMM drivers, this will return TRUE in InSmram while inside the driver's entry point and\r
2a452a56 27 otherwise FALSE. For combination SMM/DXE drivers, this will return FALSE in the DXE launch. For the\r
28 SMM launch, it behaves as an SMM driver.\r
29\r
9095d37b 30 @param[in] This The EFI_SMM_BASE2_PROTOCOL instance.\r
2a452a56 31 @param[out] InSmram Pointer to a Boolean which, on return, indicates that the driver is\r
32 currently executing inside of SMRAM (TRUE) or outside of SMRAM (FALSE).\r
33\r
34 @retval EFI_SUCCESS The call returned successfully.\r
35 @retval EFI_INVALID_PARAMETER InSmram was NULL.\r
36**/\r
37typedef\r
38EFI_STATUS\r
d64527e5 39(EFIAPI *EFI_SMM_INSIDE_OUT2)(\r
2a452a56 40 IN CONST EFI_SMM_BASE2_PROTOCOL *This,\r
41 OUT BOOLEAN *InSmram\r
42 )\r
43;\r
44\r
45/**\r
46 Returns the location of the System Management Service Table (SMST).\r
47\r
9095d37b
LG
48 This function returns the location of the System Management Service Table (SMST). The use of the\r
49 API is such that a driver can discover the location of the SMST in its entry point and then cache it in\r
2a452a56 50 some driver global variable so that the SMST can be invoked in subsequent handlers.\r
51\r
52 @param[in] This The EFI_SMM_BASE2_PROTOCOL instance.\r
53 @param[in,out] Smst On return, points to a pointer to the System Management Service Table (SMST).\r
54\r
55 @retval EFI_SUCCESS The operation was successful.\r
56 @retval EFI_INVALID_PARAMETER Smst was invalid.\r
57 @retval EFI_UNSUPPORTED Not in SMM.\r
58**/\r
59typedef\r
60EFI_STATUS\r
d64527e5 61(EFIAPI *EFI_SMM_GET_SMST_LOCATION2)(\r
2a452a56 62 IN CONST EFI_SMM_BASE2_PROTOCOL *This,\r
f981c39b 63 IN OUT EFI_SMM_SYSTEM_TABLE2 **Smst\r
2a452a56 64 )\r
65;\r
66\r
67///\r
68/// EFI SMM Base2 Protocol is utilized by all SMM drivers to locate the SMM infrastructure\r
69/// services and determine whether the driver is being invoked inside SMRAM or outside of SMRAM.\r
70///\r
71struct _EFI_SMM_BASE2_PROTOCOL {\r
d64527e5 72 EFI_SMM_INSIDE_OUT2 InSmm;\r
73 EFI_SMM_GET_SMST_LOCATION2 GetSmstLocation;\r
2a452a56 74};\r
75\r
76extern EFI_GUID gEfiSmmBase2ProtocolGuid;\r
77\r
78#endif\r
79\r