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

Go to the source code of this file.

Functions

EFI_STATUS CreateBmpFmp (VOID)
 
EFI_GUIDGetCapsuleImageTypeId (IN EFI_CAPSULE_HEADER *CapsuleHeader)
 
UINT32 GetEsrtFwType (IN EFI_GUID *ImageTypeId)
 
BOOLEAN IsValidCapsuleHeader (IN EFI_CAPSULE_HEADER *CapsuleHeader, IN UINT64 CapsuleSize)
 
BOOLEAN IsFmpCapsuleGuid (IN EFI_GUID *CapsuleGuid)
 
EFI_STATUS CreateNestedFmp (VOID)
 
EFI_STATUS ClearCapsuleStatusVariable (VOID)
 
EFI_STATUS BuildGatherList (IN VOID **CapsuleBuffer, IN UINTN *FileSize, IN UINTN CapsuleNum, OUT EFI_CAPSULE_BLOCK_DESCRIPTOR **BlockDescriptors)
 
VOID CleanGatherList (IN EFI_CAPSULE_BLOCK_DESCRIPTOR *BlockDescriptors, IN UINTN CapsuleNum)
 
VOID PrintUsage (VOID)
 
EFI_STATUS EFIAPI UefiMain (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

UINTN NumberOfDescriptors = 1
 
UINTN CapsuleFirstIndex
 
UINTN CapsuleLastIndex
 

Detailed Description

A shell application that triggers capsule update process.

Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CapsuleApp.c.

Function Documentation

◆ BuildGatherList()

EFI_STATUS BuildGatherList ( IN VOID **  CapsuleBuffer,
IN UINTN FileSize,
IN UINTN  CapsuleNum,
OUT EFI_CAPSULE_BLOCK_DESCRIPTOR **  BlockDescriptors 
)

Build Gather list for a list of capsule images.

Parameters
[in]CapsuleBufferAn array of pointer to capsule images
[in]FileSizeAn array of UINTN to capsule images size
[in]CapsuleNumThe count of capsule images
[out]BlockDescriptorsThe block descriptors for the capsule images
Return values
EFI_SUCCESSThe block descriptors for the capsule images are constructed.

Definition at line 462 of file CapsuleApp.c.

◆ CleanGatherList()

VOID CleanGatherList ( IN EFI_CAPSULE_BLOCK_DESCRIPTOR BlockDescriptors,
IN UINTN  CapsuleNum 
)

Clear the Gather list for a list of capsule images.

Parameters
[in]BlockDescriptorsThe block descriptors for the capsule images
[in]CapsuleNumThe count of capsule images

Definition at line 639 of file CapsuleApp.c.

◆ ClearCapsuleStatusVariable()

EFI_STATUS ClearCapsuleStatusVariable ( VOID  )

Clear capsule status variable.

Return values
EFI_SUCCESSThe capsule status variable is cleared.

Definition at line 402 of file CapsuleApp.c.

◆ CreateBmpFmp()

EFI_STATUS CreateBmpFmp ( VOID  )

Create UX capsule.

Return values
EFI_SUCCESSThe capsule header is appended.
EFI_UNSUPPORTEDInput parameter is not valid.
EFI_OUT_OF_RESOURCESNo enough resource to create UX capsule.

Definition at line 26 of file CapsuleApp.c.

◆ CreateNestedFmp()

EFI_STATUS CreateNestedFmp ( VOID  )

Append a capsule header on top of current image. This function follows Windows UEFI Firmware Update Platform document.

Return values
EFI_SUCCESSThe capsule header is appended.
EFI_UNSUPPORTEDInput parameter is not valid.
EFI_OUT_OF_RESOURCESNo enough resource to append capsule header.

Definition at line 300 of file CapsuleApp.c.

◆ GetCapsuleImageTypeId()

EFI_GUID * GetCapsuleImageTypeId ( IN EFI_CAPSULE_HEADER CapsuleHeader)

Get ImageTypeId in the FMP capsule header.

Parameters
[in]CapsuleHeaderThe FMP capsule image header.
Returns
ImageTypeId

Definition at line 182 of file CapsuleApp.c.

◆ GetEsrtFwType()

UINT32 GetEsrtFwType ( IN EFI_GUID ImageTypeId)

Get ESRT FwType according to ImageTypeId

Parameters
[in]ImageTypeIdImageTypeId of an FMP capsule.
Returns
ESRT FwType

Definition at line 208 of file CapsuleApp.c.

◆ IsFmpCapsuleGuid()

BOOLEAN IsFmpCapsuleGuid ( IN EFI_GUID CapsuleGuid)

Return if this CapsuleGuid is a FMP capsule GUID or not.

Parameters
[in]CapsuleGuidA pointer to EFI_GUID
Return values
TRUEIt is a FMP capsule GUID.
FALSEIt is not a FMP capsule GUID.

Definition at line 280 of file CapsuleApp.c.

◆ IsValidCapsuleHeader()

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.

Parameters
[in]CapsuleHeaderPoints to a capsule header.
[in]CapsuleSizeSize of the whole capsule image.

Definition at line 247 of file CapsuleApp.c.

◆ PrintUsage()

VOID PrintUsage ( VOID  )

Print APP usage.

Definition at line 674 of file CapsuleApp.c.

◆ UefiMain()

EFI_STATUS EFIAPI UefiMain ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Update Capsule image.

Parameters
[in]ImageHandleThe image handle.
[in]SystemTableThe system table.
Return values
EFI_SUCCESSCommand completed successfully.
EFI_UNSUPPORTEDCommand usage unsupported.
EFI_INVALID_PARAMETERCommand usage invalid.
EFI_NOT_FOUNDThe input file can't be found.

Definition at line 729 of file CapsuleApp.c.

Variable Documentation

◆ CapsuleFirstIndex

UINTN CapsuleFirstIndex

Definition at line 15 of file CapsuleApp.c.

◆ CapsuleLastIndex

UINTN CapsuleLastIndex

Definition at line 16 of file CapsuleApp.c.

◆ NumberOfDescriptors

UINTN NumberOfDescriptors = 1

Definition at line 14 of file CapsuleApp.c.