]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / PrivilegePolymorphic.h
index b98b8556a23a96361da84a6c37176b9e6765b817..065c75a64269723176295adb854d354c4cf59dc2 100644 (file)
@@ -7,16 +7,11 @@
   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
@@ -31,8 +26,8 @@
 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
@@ -77,11 +72,87 @@ MorLockInitAtEndOfDxe (
 **/\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
+  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