TianoCore EDK2 master
|
#include "CapsuleApp.h"
Go to the source code of this file.
Functions | |
BOOLEAN | IsValidCapsuleHeader (IN EFI_CAPSULE_HEADER *CapsuleHeader, IN UINT64 CapsuleSize) |
VOID | DumpUxCapsule (IN EFI_CAPSULE_HEADER *CapsuleHeader) |
VOID | DumpFmpCapsule (IN EFI_CAPSULE_HEADER *CapsuleHeader) |
BOOLEAN | IsNestedFmpCapsule (IN EFI_CAPSULE_HEADER *CapsuleHeader) |
EFI_STATUS | DumpCapsule (IN CHAR16 *CapsuleName) |
EFI_STATUS | DumpCapsuleStatusVariable (VOID) |
CHAR8 * | FwTypeToString (IN UINT32 FwType) |
CHAR8 * | LastAttemptStatusToString (IN UINT32 LastAttemptStatus) |
VOID | DumpEsrtEntry (IN EFI_SYSTEM_RESOURCE_ENTRY *EsrtEntry) |
VOID | DumpEsrt (IN EFI_SYSTEM_RESOURCE_TABLE *Esrt) |
VOID | DumpEsrtData (VOID) |
EFI_STATUS | DumpCapsuleFromBuffer (IN EFI_CAPSULE_HEADER *CapsuleHeader) |
STATIC CHAR16 * | UpperCaseString (IN CHAR16 *Str) |
STATIC VOID | GetSubStringBeforePeriod (IN CHAR16 *Str, OUT CHAR16 *SubStr, OUT UINTN *SubStrLen) |
STATIC VOID | PadStrInTail (IN CHAR16 *StrBuf, IN UINTN PadLen, IN CHAR16 Character) |
STATIC VOID | SplitFileNameExtension (IN CHAR16 *FileName, OUT CHAR16 *FileNameFirst, OUT CHAR16 *FileNameExtension) |
INTN EFIAPI | CompareFileNameInAlphabet (IN VOID *Left, IN VOID *Right) |
EFI_STATUS | DumpCapsuleFromDisk (IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Fs, IN BOOLEAN DumpCapsuleInfo) |
VOID | DumpBlockDescriptors (IN EFI_CAPSULE_BLOCK_DESCRIPTOR *BlockDescriptors, IN BOOLEAN DumpCapsuleInfo) |
VOID | DumpProvisionedCapsule (IN BOOLEAN DumpCapsuleInfo) |
VOID | DumpFmpImageInfo (IN UINTN ImageInfoSize, IN EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo, IN UINT32 DescriptorVersion, IN UINT8 DescriptorCount, IN UINTN DescriptorSize, IN UINT32 PackageVersion, IN CHAR16 *PackageVersionName) |
VOID | DumpFmpPackageInfo (IN UINT32 PackageVersion, IN CHAR16 *PackageVersionName, IN UINT32 PackageVersionNameMaxLen, IN UINT64 AttributesSupported, IN UINT64 AttributesSetting) |
VOID | DumpFmpData (VOID) |
BOOLEAN | IsThisFmpImageInfo (IN EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo, IN UINT8 DescriptorCount, IN UINTN DescriptorSize, IN EFI_GUID *ImageTypeId) |
EFI_FIRMWARE_MANAGEMENT_PROTOCOL * | FindFmpFromImageTypeId (IN EFI_GUID *ImageTypeId) |
VOID | DumpFmpImage (IN EFI_GUID *ImageTypeId, IN UINTN ImageIndex, IN CHAR16 *ImageName) |
Variables | |
CHAR8 * | mFwTypeString [] |
CHAR8 * | mLastAttemptStatusString [] |
Dump Capsule image information.
Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CapsuleDump.c.
The function is called by PerformQuickSort to sort file name in alphabet.
[in] | Left | The pointer to first buffer. |
[in] | Right | The pointer to second buffer. |
0 | Buffer1 equal to Buffer2. |
Definition at line 636 of file CapsuleDump.c.
VOID DumpBlockDescriptors | ( | IN EFI_CAPSULE_BLOCK_DESCRIPTOR * | BlockDescriptors, |
IN BOOLEAN | DumpCapsuleInfo | ||
) |
Dump capsule inforomation form Gather list.
[in] | BlockDescriptors | The block descriptors for the capsule images |
[in] | DumpCapsuleInfo | The flag to indicate whether to dump the capsule inforomation. |
Definition at line 872 of file CapsuleDump.c.
EFI_STATUS DumpCapsule | ( | IN CHAR16 * | CapsuleName | ) |
Dump capsule information
[in] | CapsuleName | The name of the capsule image. |
EFI_SUCCESS | The capsule information is dumped. |
EFI_UNSUPPORTED | Input parameter is not valid. |
Definition at line 175 of file CapsuleDump.c.
EFI_STATUS DumpCapsuleFromBuffer | ( | IN EFI_CAPSULE_HEADER * | CapsuleHeader | ) |
Dump capsule information from CapsuleHeader
[in] | CapsuleHeader | The CapsuleHeader of the capsule image. |
EFI_SUCCESS | The capsule information is dumped. |
Definition at line 474 of file CapsuleDump.c.
EFI_STATUS DumpCapsuleFromDisk | ( | IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * | Fs, |
IN BOOLEAN | DumpCapsuleInfo | ||
) |
Dump capsule information from disk.
[in] | Fs | The device path of disk. |
[in] | DumpCapsuleInfo | The flag to indicate whether to dump the capsule inforomation. |
EFI_SUCCESS | The capsule information is dumped. |
Definition at line 698 of file CapsuleDump.c.
EFI_STATUS DumpCapsuleStatusVariable | ( | VOID | ) |
Dump capsule status variable.
EFI_SUCCESS | The capsule status variable is dumped. |
EFI_UNSUPPORTED | Input parameter is not valid. |
Definition at line 233 of file CapsuleDump.c.
VOID DumpEsrt | ( | IN EFI_SYSTEM_RESOURCE_TABLE * | Esrt | ) |
VOID DumpEsrtData | ( | VOID | ) |
Dump ESRT info.
Definition at line 444 of file CapsuleDump.c.
VOID DumpEsrtEntry | ( | IN EFI_SYSTEM_RESOURCE_ENTRY * | EsrtEntry | ) |
VOID DumpFmpCapsule | ( | IN EFI_CAPSULE_HEADER * | CapsuleHeader | ) |
Dump a non-nested FMP capsule.
[in] | CapsuleHeader | A pointer to CapsuleHeader |
Definition at line 63 of file CapsuleDump.c.
VOID DumpFmpData | ( | VOID | ) |
Dump FMP protocol info.
Definition at line 1125 of file CapsuleDump.c.
Dump FMP image data.
[in] | ImageTypeId | The ImageTypeId of the FMP image. It is used to identify the FMP protocol. |
[in] | ImageIndex | The ImageIndex of the FMP image. It is the input parameter for FMP->GetImage(). |
[in] | ImageName | The file name to hold the output FMP image. |
Definition at line 1420 of file CapsuleDump.c.
VOID DumpFmpImageInfo | ( | IN UINTN | ImageInfoSize, |
IN EFI_FIRMWARE_IMAGE_DESCRIPTOR * | ImageInfo, | ||
IN UINT32 | DescriptorVersion, | ||
IN UINT8 | DescriptorCount, | ||
IN UINTN | DescriptorSize, | ||
IN UINT32 | PackageVersion, | ||
IN CHAR16 * | PackageVersionName | ||
) |
Dump FMP information.
[in] | ImageInfoSize | The size of ImageInfo, in bytes. |
[in] | ImageInfo | A pointer to EFI_FIRMWARE_IMAGE_DESCRIPTOR. |
[in] | DescriptorVersion | The version of EFI_FIRMWARE_IMAGE_DESCRIPTOR. |
[in] | DescriptorCount | The count of EFI_FIRMWARE_IMAGE_DESCRIPTOR. |
[in] | DescriptorSize | The size of an individual EFI_FIRMWARE_IMAGE_DESCRIPTOR, in bytes. |
[in] | PackageVersion | The version of package. |
[in] | PackageVersionName | The version name of package. |
Definition at line 1018 of file CapsuleDump.c.
VOID DumpFmpPackageInfo | ( | IN UINT32 | PackageVersion, |
IN CHAR16 * | PackageVersionName, | ||
IN UINT32 | PackageVersionNameMaxLen, | ||
IN UINT64 | AttributesSupported, | ||
IN UINT64 | AttributesSetting | ||
) |
Dump FMP package information.
[in] | PackageVersion | The version of package. |
[in] | PackageVersionName | The version name of package. |
[in] | PackageVersionNameMaxLen | The maximum length of PackageVersionName. |
[in] | AttributesSupported | Package attributes that are supported by this device. |
[in] | AttributesSetting | Package attributes. |
Definition at line 1100 of file CapsuleDump.c.
VOID DumpProvisionedCapsule | ( | IN BOOLEAN | DumpCapsuleInfo | ) |
Dump Provisioned Capsule.
[in] | DumpCapsuleInfo | The flag to indicate whether to dump the capsule inforomation. |
Definition at line 911 of file CapsuleDump.c.
VOID DumpUxCapsule | ( | IN EFI_CAPSULE_HEADER * | CapsuleHeader | ) |
Dump UX capsule information.
[in] | CapsuleHeader | The UX capsule header |
Definition at line 35 of file CapsuleDump.c.
EFI_FIRMWARE_MANAGEMENT_PROTOCOL * FindFmpFromImageTypeId | ( | IN EFI_GUID * | ImageTypeId | ) |
return the FMP whoes ImageInfo includes the ImageTypeId.
[in] | ImageTypeId | A unique GUID identifying the firmware image type. |
Definition at line 1308 of file CapsuleDump.c.
CHAR8 * FwTypeToString | ( | IN UINT32 | FwType | ) |
Convert FwType to a string.
[in] | FwType | FwType in ESRT |
Definition at line 361 of file CapsuleDump.c.
STATIC VOID GetSubStringBeforePeriod | ( | IN CHAR16 * | Str, |
OUT CHAR16 * | SubStr, | ||
OUT UINTN * | SubStrLen | ||
) |
This routine is used to return substring before period '.' or '\0' Caller should respsonsible of substr space allocation & free
[in] | Str | String to check |
[out] | SubStr | First part of string before period or '\0' |
[out] | SubStrLen | Length of first part of string |
Definition at line 536 of file CapsuleDump.c.
BOOLEAN IsNestedFmpCapsule | ( | IN EFI_CAPSULE_HEADER * | CapsuleHeader | ) |
Return if there is a FMP header below capsule header.
[in] | CapsuleHeader | A pointer to EFI_CAPSULE_HEADER |
TRUE | There is a FMP header below capsule header. |
FALSE | There is not a FMP header below capsule header |
Definition at line 117 of file CapsuleDump.c.
BOOLEAN IsThisFmpImageInfo | ( | IN EFI_FIRMWARE_IMAGE_DESCRIPTOR * | ImageInfo, |
IN UINT8 | DescriptorCount, | ||
IN UINTN | DescriptorSize, | ||
IN EFI_GUID * | ImageTypeId | ||
) |
Check if the ImageInfo includes the ImageTypeId.
[in] | ImageInfo | A pointer to EFI_FIRMWARE_IMAGE_DESCRIPTOR. |
[in] | DescriptorCount | The count of EFI_FIRMWARE_IMAGE_DESCRIPTOR. |
[in] | DescriptorSize | The size of an individual EFI_FIRMWARE_IMAGE_DESCRIPTOR, in bytes. |
[in] | ImageTypeId | A unique GUID identifying the firmware image type. |
Definition at line 1278 of file CapsuleDump.c.
BOOLEAN IsValidCapsuleHeader | ( | IN EFI_CAPSULE_HEADER * | CapsuleHeader, |
IN UINT64 | CapsuleSize | ||
) |
Validate if it is valid capsule header
This function assumes the caller provided correct CapsuleHeader pointer and CapsuleSize.
This function validates the fields in EFI_CAPSULE_HEADER.
[in] | CapsuleHeader | Points to a capsule header. |
[in] | CapsuleSize | Size of the whole capsule image. |
Validate if it is valid capsule header
Caution: This function may receive untrusted input.
This function assumes the caller provided correct CapsuleHeader pointer and CapsuleSize.
This function validates the fields in EFI_CAPSULE_HEADER.
[in] | CapsuleHeader | Points to a capsule header. |
[in] | CapsuleSize | Size of the whole capsule image. |
Definition at line 247 of file CapsuleApp.c.
CHAR8 * LastAttemptStatusToString | ( | IN UINT32 | LastAttemptStatus | ) |
Convert LastAttemptStatus to a string.
[in] | LastAttemptStatus | LastAttemptStatus in FMP or ESRT |
Definition at line 380 of file CapsuleDump.c.
This routine pad the string in tail with input character.
[in] | StrBuf | Str buffer to be padded, should be enough room for |
[in] | PadLen | Expected padding length |
[in] | Character | Character used to pad |
Definition at line 562 of file CapsuleDump.c.
STATIC VOID SplitFileNameExtension | ( | IN CHAR16 * | FileName, |
OUT CHAR16 * | FileNameFirst, | ||
OUT CHAR16 * | FileNameExtension | ||
) |
This routine find the offset of the last period '.' of string. if No period exists function FileNameExtension is set to L'\0'
[in] | FileName | File name to split between last period |
[out] | FileNameFirst | First FileName before last period |
[out] | FileNameExtension | FileName after last period |
Definition at line 593 of file CapsuleDump.c.
This routine is called to upper case given unicode string.
[in] | Str | String to upper case |
upper | cased string after process |
Definition at line 510 of file CapsuleDump.c.
CHAR8* mFwTypeString[] |
Definition at line 334 of file CapsuleDump.c.
CHAR8* mLastAttemptStatusString[] |
Definition at line 341 of file CapsuleDump.c.