TianoCore EDK2 master
Loading...
Searching...
No Matches
CapsuleApp.h File Reference

Go to the source code of this file.

Macros

#define CAPSULE_HEADER_SIZE   0x20
 
#define NESTED_CAPSULE_HEADER_SIZE   SIZE_4KB
 
#define SYSTEM_FIRMWARE_FLAG   0x50000
 
#define DEVICE_FIRMWARE_FLAG   0x78010
 
#define MAJOR_VERSION   1
 
#define MINOR_VERSION   0
 
#define MAX_CAPSULE_NUM   10
 
#define MAX_FILE_NAME_SIZE   522
 
#define MAX_FILE_NAME_LEN   (MAX_FILE_NAME_SIZE / sizeof(CHAR16))
 

Functions

EFI_STATUS GetArg (VOID)
 
EFI_SHELL_PROTOCOLGetShellProtocol (VOID)
 
EFI_STATUS ReadFileToBuffer (IN CHAR16 *FileName, OUT UINTN *BufferSize, OUT VOID **Buffer)
 
EFI_STATUS WriteFileFromBuffer (IN CHAR16 *FileName, IN UINTN BufferSize, IN VOID *Buffer)
 
EFI_STATUS DumpCapsule (IN CHAR16 *CapsuleName)
 
EFI_STATUS DumpCapsuleStatusVariable (VOID)
 
VOID DumpFmpData (VOID)
 
VOID DumpFmpImage (IN EFI_GUID *ImageTypeId, IN UINTN ImageIndex, IN CHAR16 *ImageName)
 
VOID DumpEsrtData (VOID)
 
VOID DumpProvisionedCapsule (IN BOOLEAN DumpCapsuleInfo)
 
VOID DumpAllEfiSysPartition (VOID)
 
EFI_STATUS GetEfiSysPartitionFromBootOptionFilePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **FullPath, OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **Fs)
 
EFI_STATUS ProcessCapsuleOnDisk (IN VOID **CapsuleBuffer, IN UINTN *CapsuleBufferSize, IN CHAR16 **FilePath, IN CHAR16 *Map, IN UINTN CapsuleNum)
 

Variables

UINTN Argc
 
CHAR16 ** Argv
 

Detailed Description

A shell application that triggers capsule update process.

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

Definition in file CapsuleApp.h.

Macro Definition Documentation

◆ CAPSULE_HEADER_SIZE

#define CAPSULE_HEADER_SIZE   0x20

Definition at line 41 of file CapsuleApp.h.

◆ DEVICE_FIRMWARE_FLAG

#define DEVICE_FIRMWARE_FLAG   0x78010

Definition at line 45 of file CapsuleApp.h.

◆ MAJOR_VERSION

#define MAJOR_VERSION   1

Definition at line 47 of file CapsuleApp.h.

◆ MAX_CAPSULE_NUM

#define MAX_CAPSULE_NUM   10

Definition at line 50 of file CapsuleApp.h.

◆ MAX_FILE_NAME_LEN

#define MAX_FILE_NAME_LEN   (MAX_FILE_NAME_SIZE / sizeof(CHAR16))

Definition at line 56 of file CapsuleApp.h.

◆ MAX_FILE_NAME_SIZE

#define MAX_FILE_NAME_SIZE   522

Definition at line 55 of file CapsuleApp.h.

◆ MINOR_VERSION

#define MINOR_VERSION   0

Definition at line 48 of file CapsuleApp.h.

◆ NESTED_CAPSULE_HEADER_SIZE

#define NESTED_CAPSULE_HEADER_SIZE   SIZE_4KB

Definition at line 43 of file CapsuleApp.h.

◆ SYSTEM_FIRMWARE_FLAG

#define SYSTEM_FIRMWARE_FLAG   0x50000

Definition at line 44 of file CapsuleApp.h.

Function Documentation

◆ DumpAllEfiSysPartition()

VOID DumpAllEfiSysPartition ( VOID  )

Dump all EFI System Partition.

Definition at line 115 of file CapsuleOnDisk.c.

◆ DumpCapsule()

EFI_STATUS DumpCapsule ( IN CHAR16 *  CapsuleName)

Dump capsule information

Parameters
[in]CapsuleNameThe name of the capsule image.
Return values
EFI_SUCCESSThe capsule information is dumped.
EFI_UNSUPPORTEDInput parameter is not valid.

Definition at line 175 of file CapsuleDump.c.

◆ DumpCapsuleStatusVariable()

EFI_STATUS DumpCapsuleStatusVariable ( VOID  )

Dump capsule status variable.

Return values
EFI_SUCCESSThe capsule status variable is dumped.
EFI_UNSUPPORTEDInput parameter is not valid.

Definition at line 233 of file CapsuleDump.c.

◆ DumpEsrtData()

VOID DumpEsrtData ( VOID  )

Dump ESRT info.

Definition at line 444 of file CapsuleDump.c.

◆ DumpFmpData()

VOID DumpFmpData ( VOID  )

Dump FMP protocol info.

Definition at line 1125 of file CapsuleDump.c.

◆ DumpFmpImage()

VOID DumpFmpImage ( IN EFI_GUID ImageTypeId,
IN UINTN  ImageIndex,
IN CHAR16 *  ImageName 
)

Dump FMP image data.

Parameters
[in]ImageTypeIdThe ImageTypeId of the FMP image. It is used to identify the FMP protocol.
[in]ImageIndexThe ImageIndex of the FMP image. It is the input parameter for FMP->GetImage().
[in]ImageNameThe file name to hold the output FMP image.

Definition at line 1420 of file CapsuleDump.c.

◆ DumpProvisionedCapsule()

VOID DumpProvisionedCapsule ( IN BOOLEAN  DumpCapsuleInfo)

Dump Provisioned Capsule.

Parameters
[in]DumpCapsuleInfoThe flag to indicate whether to dump the capsule inforomation.

Definition at line 911 of file CapsuleDump.c.

◆ GetArg()

EFI_STATUS GetArg ( VOID  )

This function parse application ARG.

Returns
Status

Definition at line 30 of file RedfishPlatformConfig.c.

◆ GetEfiSysPartitionFromBootOptionFilePath()

EFI_STATUS GetEfiSysPartitionFromBootOptionFilePath ( IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
OUT EFI_DEVICE_PATH_PROTOCOL **  FullPath,
OUT EFI_SIMPLE_FILE_SYSTEM_PROTOCOL **  Fs 
)

Get SimpleFileSystem from boot option file path.

Parameters
[in]DevicePathThe file path of boot option
[out]FullPathThe full device path of boot device
[out]FsThe file system within EfiSysPartition
Return values
EFI_SUCCESSGet file system successfully
EFI_NOT_FOUNDNo valid file system found
othersGet file system failed

Definition at line 314 of file CapsuleOnDisk.c.

◆ GetShellProtocol()

EFI_SHELL_PROTOCOL * GetShellProtocol ( VOID  )

Get shell protocol.

Returns
Pointer to shell protocol.

Definition at line 49 of file AppSupport.c.

◆ ProcessCapsuleOnDisk()

EFI_STATUS ProcessCapsuleOnDisk ( IN VOID **  CapsuleBuffer,
IN UINTN CapsuleBufferSize,
IN CHAR16 **  FilePath,
IN CHAR16 *  Map,
IN UINTN  CapsuleNum 
)

Process Capsule On Disk.

Parameters
[in]CapsuleBufferAn array of pointer to capsule images
[in]CapsuleBufferSizeAn array of UINTN to capsule images size
[in]FilePathAn array of capsule images file path
[in]MapFile system mapping string
[in]CapsuleNumThe count of capsule images
Return values
EFI_SUCCESSCapsule on disk success.
othersCapsule on disk fail.

Definition at line 783 of file CapsuleOnDisk.c.

◆ ReadFileToBuffer()

EFI_STATUS ReadFileToBuffer ( IN CHAR16 *  FileName,
OUT UINTN BufferSize,
OUT VOID **  Buffer 
)

Read a file.

Parameters
[in]FileNameThe file to be read.
[out]BufferSizeThe file buffer size
[out]BufferThe file buffer
Return values
EFI_SUCCESSRead file successfully
EFI_NOT_FOUNDShell protocol or file not found
othersRead file failed

Definition at line 81 of file AppSupport.c.

◆ WriteFileFromBuffer()

EFI_STATUS WriteFileFromBuffer ( IN CHAR16 *  FileName,
IN UINTN  BufferSize,
IN VOID *  Buffer 
)

Write a file.

Parameters
[in]FileNameThe file to be written.
[in]BufferSizeThe file buffer size
[in]BufferThe file buffer
Return values
EFI_SUCCESSWrite file successfully
EFI_NOT_FOUNDShell protocol not found
othersWrite file failed

Definition at line 159 of file AppSupport.c.

Variable Documentation

◆ Argc

UINTN Argc
extern

Definition at line 20 of file RedfishPlatformConfig.c.

◆ Argv

CHAR16** Argv
extern

Definition at line 21 of file RedfishPlatformConfig.c.