TianoCore EDK2 master
Loading...
Searching...
No Matches
BmMisc.c File Reference
#include "InternalBm.h"

Go to the source code of this file.

Functions

EFI_DEVICE_PATH_PROTOCOLBmDelPartMatchInstance (IN EFI_DEVICE_PATH_PROTOCOL *Multi, IN EFI_DEVICE_PATH_PROTOCOL *Single)
 
BOOLEAN BmMatchDevicePaths (IN EFI_DEVICE_PATH_PROTOCOL *Multi, IN EFI_DEVICE_PATH_PROTOCOL *Single)
 
VOID BmSetMemoryTypeInformationVariable (IN BOOLEAN Boot)
 
EFI_STATUS BmSetVariableAndReportStatusCodeOnError (IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
 
VOID BmPrintDp (EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 
UINTN BmCharToUint (IN CHAR16 Char)
 
EFI_STATUS EFIAPI EfiBootManagerDispatchDeferredImages (VOID)
 

Detailed Description

Misc library functions.

Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file BmMisc.c.

Function Documentation

◆ BmCharToUint()

UINTN BmCharToUint ( IN CHAR16  Char)

Convert a single character to number. It assumes the input Char is in the scope of L'0' ~ L'9' and L'A' ~ L'F'

Parameters
CharThe input char which need to convert to int.
Returns
The converted 8-bit number or (UINTN) -1 if conversion failed.

Definition at line 404 of file BmMisc.c.

◆ BmDelPartMatchInstance()

EFI_DEVICE_PATH_PROTOCOL * BmDelPartMatchInstance ( IN EFI_DEVICE_PATH_PROTOCOL Multi,
IN EFI_DEVICE_PATH_PROTOCOL Single 
)

Delete the instance in Multi which matches partly with Single instance

Parameters
MultiA pointer to a multi-instance device path data structure.
SingleA pointer to a single-instance device path data structure.
Returns
This function will remove the device path instances in Multi which partly match with the Single, and return the result device path. If there is no remaining device path as a result, this function will return NULL.

Definition at line 26 of file BmMisc.c.

◆ BmMatchDevicePaths()

BOOLEAN BmMatchDevicePaths ( IN EFI_DEVICE_PATH_PROTOCOL Multi,
IN EFI_DEVICE_PATH_PROTOCOL Single 
)

Function compares a device path data structure to that of all the nodes of a second device path instance.

Parameters
MultiA pointer to a multi-instance device path data structure.
SingleA pointer to a single-instance device path data structure.
Return values
TRUEIf the Single device path is contained within Multi device path.
FALSEThe Single device path is not match within Multi device path.

Definition at line 82 of file BmMisc.c.

◆ BmPrintDp()

VOID BmPrintDp ( EFI_DEVICE_PATH_PROTOCOL DevicePath)

Print the device path info.

Parameters
DevicePathThe device path need to print.

Definition at line 382 of file BmMisc.c.

◆ BmSetMemoryTypeInformationVariable()

VOID BmSetMemoryTypeInformationVariable ( IN BOOLEAN  Boot)

This routine adjust the memory information for different memory type and save them into the variables for next boot. It resets the system when memory information is updated and the current boot option belongs to boot category instead of application category. It doesn't count the reserved memory occupied by RAM Disk.

Parameters
BootTRUE if current boot option belongs to boot category instead of application category.

Definition at line 129 of file BmMisc.c.

◆ BmSetVariableAndReportStatusCodeOnError()

EFI_STATUS BmSetVariableAndReportStatusCodeOnError ( IN CHAR16 *  VariableName,
IN EFI_GUID VendorGuid,
IN UINT32  Attributes,
IN UINTN  DataSize,
IN VOID *  Data 
)

Set the variable and report the error through status code upon failure.

Parameters
VariableNameA Null-terminated string that is the name of the vendor's variable. Each VariableName is unique for each VendorGuid. VariableName must contain 1 or more characters. If VariableName is an empty string, then EFI_INVALID_PARAMETER is returned.
VendorGuidA unique identifier for the vendor.
AttributesAttributes bitmask to set for the variable.
DataSizeThe size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE, or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is set, then a SetVariable() call with a DataSize of zero will not cause any change to the variable value (the timestamp associated with the variable may be updated however even if no new data value is provided,see the description of the EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated).
DataThe contents for the variable.
Return values
EFI_SUCCESSThe firmware has successfully stored the variable and its data as defined by the Attributes.
EFI_INVALID_PARAMETERAn invalid combination of attribute bits, name, and GUID was supplied, or the DataSize exceeds the maximum allowed.
EFI_INVALID_PARAMETERVariableName is an empty string.
EFI_OUT_OF_RESOURCESNot enough storage is available to hold the variable and its data.
EFI_DEVICE_ERRORThe variable could not be retrieved due to a hardware error.
EFI_WRITE_PROTECTEDThe variable in question is read-only.
EFI_WRITE_PROTECTEDThe variable in question cannot be deleted.
EFI_SECURITY_VIOLATIONThe variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo does NOT pass the validation check carried out by the firmware.
EFI_NOT_FOUNDThe variable trying to be updated or deleted was not found.

Definition at line 328 of file BmMisc.c.

◆ EfiBootManagerDispatchDeferredImages()

EFI_STATUS EFIAPI EfiBootManagerDispatchDeferredImages ( VOID  )

Dispatch the deferred images that are returned from all DeferredImageLoad instances.

Return values
EFI_SUCCESSAt least one deferred image is loaded successfully and started.
EFI_NOT_FOUNDThere is no deferred image.
EFI_ACCESS_DENIEDThere are deferred images but all of them are failed to load.

Definition at line 428 of file BmMisc.c.