3 Parts of the SMM/MM implementation that are specific to traditional MM
5 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved. <BR>
6 Copyright (c) 2018, Linaro, Ltd. All rights reserved. <BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include <Library/UefiBootServicesTableLib.h>
12 #include <Library/SmmMemLib.h>
16 This function checks if the buffer is valid per processor architecture and
17 does not overlap with SMRAM.
19 @param Buffer The buffer start address to be checked.
20 @param Length The buffer length to be checked.
22 @retval TRUE This buffer is valid per processor architecture and does not
24 @retval FALSE This buffer is not valid per processor architecture or overlaps
28 VariableSmmIsBufferOutsideSmmValid (
29 IN EFI_PHYSICAL_ADDRESS Buffer
,
33 return SmmIsBufferOutsideSmmValid (Buffer
, Length
);
37 Notify the system that the SMM variable driver is ready.
40 VariableNotifySmmReady (
48 Status
= gBS
->InstallProtocolInterface (
50 &gEfiSmmVariableProtocolGuid
,
54 ASSERT_EFI_ERROR (Status
);
58 Notify the system that the SMM variable write driver is ready.
61 VariableNotifySmmWriteReady (
69 Status
= gBS
->InstallProtocolInterface (
71 &gSmmVariableWriteGuid
,
75 ASSERT_EFI_ERROR (Status
);
79 Variable service MM driver entry point
81 @param[in] ImageHandle A handle for the image that is initializing this
83 @param[in] SystemTable A pointer to the EFI system table
85 @retval EFI_SUCCESS Variable service successfully initialized.
89 VariableServiceInitialize (
90 IN EFI_HANDLE ImageHandle
,
91 IN EFI_SYSTEM_TABLE
*SystemTable
94 return MmVariableServiceInitialize ();
98 Whether the TCG or TCG2 protocols are installed in the UEFI protocol database.
99 This information is used by the MorLock code to infer whether an existing
100 MOR variable is legitimate or not.
102 @retval TRUE Either the TCG or TCG2 protocol is installed in the UEFI
104 @retval FALSE Neither the TCG nor the TCG2 protocol is installed in the UEFI
108 VariableHaveTcgProtocols (
115 Status
= gBS
->LocateProtocol (
116 &gEfiTcg2ProtocolGuid
,
117 NULL
, // Registration
120 if (!EFI_ERROR (Status
)) {
124 Status
= gBS
->LocateProtocol (
125 &gEfiTcgProtocolGuid
,
126 NULL
, // Registration
129 return !EFI_ERROR (Status
);