MdeModulePkg:Create Boot Maintenance Manager Library
Split the boot maintenance manager library from UiApp in MdeModulePkg/Application and put the library in MdeModulePkg/Library. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18923 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
89
MdeModulePkg/Library/BootMaintenanceManagerLib/BmLib.c
Normal file
89
MdeModulePkg/Library/BootMaintenanceManagerLib/BmLib.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/** @file
|
||||
Utility routines used by boot maintenance modules.
|
||||
|
||||
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include "BootMaintenanceManager.h"
|
||||
|
||||
/**
|
||||
Function deletes the variable specified by VarName and VarGuid.
|
||||
|
||||
@param VarName A Null-terminated Unicode string that is
|
||||
the name of the vendor's variable.
|
||||
|
||||
@param VarGuid A unique identifier for the vendor.
|
||||
|
||||
@retval EFI_SUCCESS The variable was found and removed
|
||||
@retval EFI_UNSUPPORTED The variable store was inaccessible
|
||||
@retval EFI_NOT_FOUND The variable was not found
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EfiLibDeleteVariable (
|
||||
IN CHAR16 *VarName,
|
||||
IN EFI_GUID *VarGuid
|
||||
)
|
||||
{
|
||||
return gRT->SetVariable (
|
||||
VarName,
|
||||
VarGuid,
|
||||
0,
|
||||
0,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
Function is used to determine the number of device path instances
|
||||
that exist in a device path.
|
||||
|
||||
|
||||
@param DevicePath A pointer to a device path data structure.
|
||||
|
||||
@return This function counts and returns the number of device path instances
|
||||
in DevicePath.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
EfiDevicePathInstanceCount (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
)
|
||||
{
|
||||
UINTN Count;
|
||||
UINTN Size;
|
||||
|
||||
Count = 0;
|
||||
while (GetNextDevicePathInstance (&DevicePath, &Size) != NULL) {
|
||||
Count += 1;
|
||||
}
|
||||
|
||||
return Count;
|
||||
}
|
||||
|
||||
/**
|
||||
Get a string from the Data Hub record based on
|
||||
a device path.
|
||||
|
||||
@param DevPath The device Path.
|
||||
|
||||
@return A string located from the Data Hub records based on
|
||||
the device path.
|
||||
@retval NULL If failed to get the String from Data Hub.
|
||||
|
||||
**/
|
||||
UINT16 *
|
||||
EfiLibStrFromDatahub (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevPath
|
||||
)
|
||||
{
|
||||
return NULL;
|
||||
}
|
Reference in New Issue
Block a user