]> git.proxmox.com Git - mirror_edk2.git/blob - StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.c
f0a46b2516dc4f0ec8d59cc5d04a3761c98b680d
[mirror_edk2.git] / StandaloneMmPkg / Library / VariableMmDependency / VariableMmDependency.c
1 /** @file
2 Runtime DXE part corresponding to StanaloneMM variable module.
3
4 This module installs variable arch protocol and variable write arch protocol
5 to StandaloneMM runtime variable service.
6
7 Copyright (c) 2019, ARM Ltd. All rights reserved.
8
9 This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php.
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16
17 **/
18
19 #include <Library/DebugLib.h>
20 #include <Library/UefiBootServicesTableLib.h>
21
22 /**
23 The constructor function installs variable arch protocol and variable
24 write arch protocol to StandaloneMM runtime variable service
25
26 @param ImageHandle The firmware allocated handle for the EFI image.
27 @param SystemTable A pointer to the Management mode System Table.
28
29 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
30
31 **/
32 EFI_STATUS
33 EFIAPI
34 VariableMmDependencyLibConstructor (
35 IN EFI_HANDLE ImageHandle,
36 IN EFI_SYSTEM_TABLE *SystemTable
37 )
38 {
39 EFI_STATUS Status;
40 EFI_HANDLE Handle;
41
42 Handle = NULL;
43 Status = gBS->InstallMultipleProtocolInterfaces (
44 &Handle,
45 &gEfiSmmVariableProtocolGuid,
46 NULL,
47 &gSmmVariableWriteGuid,
48 NULL,
49 NULL
50 );
51 ASSERT_EFI_ERROR (Status);
52 return EFI_SUCCESS;
53 }