--- /dev/null
+/** @file\r
+ Runtime DXE part corresponding to StanaloneMM variable module.\r
+\r
+This module installs variable arch protocol and variable write arch protocol\r
+to StandaloneMM runtime variable service.\r
+\r
+Copyright (c) 2019, ARM Ltd. All rights reserved.\r
+\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this 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,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+\r
+/**\r
+ The constructor function installs variable arch protocol and variable\r
+ write arch protocol to StandaloneMM runtime variable service\r
+\r
+ @param ImageHandle The firmware allocated handle for the EFI image.\r
+ @param SystemTable A pointer to the Management mode System Table.\r
+\r
+ @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+VariableMmDependencyLibConstructor (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_HANDLE Handle;\r
+\r
+ Handle = NULL;\r
+ Status = gBS->InstallMultipleProtocolInterfaces (\r
+ &Handle,\r
+ &gEfiSmmVariableProtocolGuid,\r
+ NULL,\r
+ &gSmmVariableWriteGuid,\r
+ NULL,\r
+ NULL\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+ return EFI_SUCCESS;\r
+}\r
--- /dev/null
+## @file\r
+# Runtime DXE part corresponding to StanaloneMM variable module.\r
+#\r
+# This module installs variable arch protocol and variable write arch protocol\r
+# to StandaloneMM runtime variable service.\r
+#\r
+# Copyright (c) 2019, ARM Ltd. All rights reserved.\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+##\r
+\r
+[Defines]\r
+ INF_VERSION = 0x0001001A\r
+ BASE_NAME = VariableMmDependency\r
+ FILE_GUID = 64BC4129-778E-4867-BA07-13999A4DEC3F\r
+ MODULE_TYPE = DXE_DRIVER\r
+ LIBRARY_CLASS = NULL\r
+ CONSTRUCTOR = VariableMmDependencyLibConstructor\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = AARCH64\r
+#\r
+#\r
+\r
+[Sources]\r
+ VariableMmDependency.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ MdeModulePkg/MdeModulePkg.dec\r
+\r
+[Protocols]\r
+ gEfiSmmVariableProtocolGuid ## PRODUCES\r
+\r
+[Guids]\r
+ gSmmVariableWriteGuid ## PRODUCES ## GUID # Install protocol\r
+\r
+[Depex]\r
+ TRUE\r