vs. non-privileged driver code.\r
\r
Copyright (c) 2017, Red Hat, Inc.<BR>\r
- Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
- This program and the accompanying materials are licensed and made available\r
- under the terms and conditions of the BSD License which accompanies this\r
- distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
- WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
**/\r
+\r
#ifndef _PRIVILEGE_POLYMORPHIC_H_\r
#define _PRIVILEGE_POLYMORPHIC_H_\r
\r
VOID\r
EFIAPI\r
SecureBootHook (\r
- IN CHAR16 *VariableName,\r
- IN EFI_GUID *VendorGuid\r
+ IN CHAR16 *VariableName,\r
+ IN EFI_GUID *VendorGuid\r
+ );\r
+\r
+/**\r
+ Initialization for MOR Control Lock.\r
+\r
+ @retval EFI_SUCCESS MorLock initialization success.\r
+ @return Others Some error occurs.\r
+**/\r
+EFI_STATUS\r
+MorLockInit (\r
+ VOID\r
+ );\r
+\r
+/**\r
+ Delayed initialization for MOR Control Lock at EndOfDxe.\r
+\r
+ This function performs any operations queued by MorLockInit().\r
+**/\r
+VOID\r
+MorLockInitAtEndOfDxe (\r
+ VOID\r
+ );\r
+\r
+/**\r
+ This service is an MOR/MorLock checker handler for the SetVariable().\r
+\r
+ @param[in] VariableName the name of the vendor's variable, as a\r
+ Null-Terminated Unicode String\r
+ @param[in] VendorGuid Unify identifier for vendor.\r
+ @param[in] Attributes Attributes bitmask to set for the variable.\r
+ @param[in] DataSize The size in bytes of Data-Buffer.\r
+ @param[in] Data Point to the content of the variable.\r
+\r
+ @retval EFI_SUCCESS The MOR/MorLock check pass, and Variable\r
+ driver can store the variable data.\r
+ @retval EFI_INVALID_PARAMETER The MOR/MorLock data or data size or\r
+ attributes is not allowed for MOR variable.\r
+ @retval EFI_ACCESS_DENIED The MOR/MorLock is locked.\r
+ @retval EFI_ALREADY_STARTED The MorLock variable is handled inside this\r
+ function. Variable driver can just return\r
+ EFI_SUCCESS.\r
+**/\r
+EFI_STATUS\r
+SetVariableCheckHandlerMor (\r
+ IN CHAR16 *VariableName,\r
+ IN EFI_GUID *VendorGuid,\r
+ IN UINT32 Attributes,\r
+ IN UINTN DataSize,\r
+ IN VOID *Data\r
+ );\r
+\r
+/**\r
+ This service is consumed by the variable modules to place a barrier to stop\r
+ speculative execution.\r
+\r
+ Ensures that no later instruction will execute speculatively, until all prior\r
+ instructions have completed.\r
+\r
+**/\r
+VOID\r
+VariableSpeculationBarrier (\r
+ VOID\r
+ );\r
+\r
+/**\r
+ Notify the system that the SMM variable driver is ready.\r
+**/\r
+VOID\r
+VariableNotifySmmReady (\r
+ VOID\r
+ );\r
+\r
+/**\r
+ Notify the system that the SMM variable write driver is ready.\r
+**/\r
+VOID\r
+VariableNotifySmmWriteReady (\r
+ VOID\r
+ );\r
+\r
+/**\r
+ Variable Driver main entry point. The Variable driver places the 4 EFI\r
+ runtime services in the EFI System Table and installs arch protocols\r
+ for variable read and write services being available. It also registers\r
+ a notification function for an EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.\r
+\r
+ @retval EFI_SUCCESS Variable service successfully initialized.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+MmVariableServiceInitialize (\r
+ VOID\r
+ );\r
+\r
+/**\r
+ This function checks if the buffer is valid per processor architecture and\r
+ does not overlap with SMRAM.\r
+\r
+ @param Buffer The buffer start address to be checked.\r
+ @param Length The buffer length to be checked.\r
+\r
+ @retval TRUE This buffer is valid per processor architecture and does not\r
+ overlap with SMRAM.\r
+ @retval FALSE This buffer is not valid per processor architecture or overlaps\r
+ with SMRAM.\r
+**/\r
+BOOLEAN\r
+VariableSmmIsBufferOutsideSmmValid (\r
+ IN EFI_PHYSICAL_ADDRESS Buffer,\r
+ IN UINT64 Length\r
+ );\r
+\r
+/**\r
+ Whether the TCG or TCG2 protocols are installed in the UEFI protocol database.\r
+ This information is used by the MorLock code to infer whether an existing\r
+ MOR variable is legitimate or not.\r
+\r
+ @retval TRUE Either the TCG or TCG2 protocol is installed in the UEFI\r
+ protocol database\r
+ @retval FALSE Neither the TCG nor the TCG2 protocol is installed in the UEFI\r
+ protocol database\r
+**/\r
+BOOLEAN\r
+VariableHaveTcgProtocols (\r
+ VOID\r
);\r
\r
#endif\r