diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-11 08:17:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-11 08:17:27 +0000 |
commit | f215e02bf85f68d3a6106c2a1f4f7f063f819064 (patch) | |
tree | 6bb5b92c046312c4e95ac2620b10ddf482d3fa8b /src/VBox/Devices/EFI/Firmware/StandaloneMmPkg/Library/VariableMmDependency | |
parent | Initial commit. (diff) | |
download | virtualbox-f215e02bf85f68d3a6106c2a1f4f7f063f819064.tar.xz virtualbox-f215e02bf85f68d3a6106c2a1f4f7f063f819064.zip |
Adding upstream version 7.0.14-dfsg.upstream/7.0.14-dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/Devices/EFI/Firmware/StandaloneMmPkg/Library/VariableMmDependency')
2 files changed, 88 insertions, 0 deletions
diff --git a/src/VBox/Devices/EFI/Firmware/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.c b/src/VBox/Devices/EFI/Firmware/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.c new file mode 100644 index 00000000..b09cfd24 --- /dev/null +++ b/src/VBox/Devices/EFI/Firmware/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.c @@ -0,0 +1,47 @@ +/** @file + Runtime DXE part corresponding to StandaloneMM variable module. + +This module installs variable arch protocol and variable write arch protocol +to StandaloneMM runtime variable service. + +Copyright (c) 2019 - 2021, Arm Ltd. All rights reserved. + +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include <Library/DebugLib.h> +#include <Library/UefiBootServicesTableLib.h> + +/** + The constructor function installs variable arch protocol and variable + write arch protocol to StandaloneMM runtime variable service + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the Management mode System Table. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +VariableMmDependencyLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + + Handle = NULL; + Status = gBS->InstallMultipleProtocolInterfaces ( + &Handle, + &gEfiSmmVariableProtocolGuid, + NULL, + &gSmmVariableWriteGuid, + NULL, + NULL + ); + ASSERT_EFI_ERROR (Status); + return EFI_SUCCESS; +} diff --git a/src/VBox/Devices/EFI/Firmware/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf b/src/VBox/Devices/EFI/Firmware/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf new file mode 100644 index 00000000..7e23987f --- /dev/null +++ b/src/VBox/Devices/EFI/Firmware/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf @@ -0,0 +1,41 @@ +## @file +# Runtime DXE part corresponding to StandaloneMM variable module. +# +# This module installs variable arch protocol and variable write arch protocol +# to StandaloneMM runtime variable service. +# +# Copyright (c) 2019 - 2021, Arm Ltd. All rights reserved. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x0001001A + BASE_NAME = VariableMmDependency + FILE_GUID = 64BC4129-778E-4867-BA07-13999A4DEC3F + MODULE_TYPE = DXE_DRIVER + LIBRARY_CLASS = NULL + CONSTRUCTOR = VariableMmDependencyLibConstructor + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = AARCH64 +# +# + +[Sources] + VariableMmDependency.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[Protocols] + gEfiSmmVariableProtocolGuid ## PRODUCES + +[Guids] + gSmmVariableWriteGuid ## PRODUCES ## GUID # Install protocol + +[Depex] + TRUE |