EmbeddedPkg: introduce NvVarStoreFormattedLib
[mirror_edk2.git] / EmbeddedPkg / Library / NvVarStoreFormattedLib / NvVarStoreFormattedLib.c
1 /** @file
2 A hook-in library for:
3 - MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
4 - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
5 - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
6
7 Plugging this library instance into one of the above modules makes that
8 variable service backend wait for another platform module to dynamically
9 initialize or verify EFI_FIRMWARE_VOLUME_HEADER and VARIABLE_STORE_HEADER in
10 the non-volatile variable store FVB device. The initialization / verification
11 is signaled by installing gEdkiiNvVarStoreFormattedGuid into the
12 phase-matching PPI or protocol database, with a NULL interface. (Note that
13 installing gEdkiiNvVarStoreFormattedGuid into either the DXE or the MM
14 protocol database will unblock VariableSmm -- refer to EFI_SECTION_MM_DEPEX
15 in the PI spec.)
16
17 Copyright (C) 2018, Red Hat, Inc.
18
19 This program and the accompanying materials are licensed and made available
20 under the terms and conditions of the BSD License which accompanies this
21 distribution. The full text of the license may be found at
22 http://opensource.org/licenses/bsd-license.php
23
24 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
25 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
26 **/
27
28 #include <Base.h>
29
30 RETURN_STATUS
31 EFIAPI
32 NvVarStoreFormattedInitialize (
33 VOID
34 )
35 {
36 //
37 // Do nothing, just imbue VariablePei / VariableRuntimeDxe / VariableSmm with
38 // a PPI or protocol dependency on EDKII_NV_VAR_STORE_FORMATTED_GUID.
39 //
40 return RETURN_SUCCESS;
41 }