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

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI UpdateCapsule (IN EFI_CAPSULE_HEADER **CapsuleHeaderArray, IN UINTN CapsuleCount, IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL)
 
EFI_STATUS EFIAPI QueryCapsuleCapabilities (IN EFI_CAPSULE_HEADER **CapsuleHeaderArray, IN UINTN CapsuleCount, OUT UINT64 *MaxiumCapsuleSize, OUT EFI_RESET_TYPE *ResetType)
 
EFI_STATUS EFIAPI CapsuleServiceInitialize (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

EFI_HANDLE mNewHandle = NULL
 
UINTN mTimes = 0
 
UINT32 mMaxSizePopulateCapsule = 0
 
UINT32 mMaxSizeNonPopulateCapsule = 0
 

Detailed Description

Capsule Runtime Driver produces two UEFI capsule runtime services. (UpdateCapsule, QueryCapsuleCapabilities) It installs the Capsule Architectural Protocol defined in PI1.0a to signify the capsule runtime services are ready.

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

Definition in file CapsuleService.c.

Function Documentation

◆ CapsuleServiceInitialize()

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

This code installs UEFI capsule runtime service.

Parameters
ImageHandleThe firmware allocated handle for the EFI image.
SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSUEFI Capsule Runtime Services are installed successfully.

Definition at line 378 of file CapsuleService.c.

◆ QueryCapsuleCapabilities()

EFI_STATUS EFIAPI QueryCapsuleCapabilities ( IN EFI_CAPSULE_HEADER **  CapsuleHeaderArray,
IN UINTN  CapsuleCount,
OUT UINT64 *  MaxiumCapsuleSize,
OUT EFI_RESET_TYPE ResetType 
)

Returns if the capsule can be supported via UpdateCapsule(). Notice: When PcdCapsuleInRamSupport is unsupported, even this routine returns a valid answer, the capsule still is unsupported via UpdateCapsule().

Parameters
CapsuleHeaderArrayVirtual pointer to an array of virtual pointers to the capsules being passed into update capsule.
CapsuleCountNumber of pointers to EFI_CAPSULE_HEADER in CaspuleHeaderArray.
MaxiumCapsuleSizeOn output the maximum size that UpdateCapsule() can support as an argument to UpdateCapsule() via CapsuleHeaderArray and ScatterGatherList.
ResetTypeReturns the type of reset required for the capsule update.
Return values
EFI_SUCCESSValid answer returned.
EFI_UNSUPPORTEDThe capsule image is not supported on this platform, and MaximumCapsuleSize and ResetType are undefined.
EFI_INVALID_PARAMETERMaximumCapsuleSize is NULL, or ResetTyep is NULL, Or CapsuleCount is Zero, or CapsuleImage is not valid.
EFI_OUT_OF_RESOURCESWhen ExitBootServices() has been previously called this error indicates the capsule is compatible with this platform but is not capable of being submitted or processed in runtime. The caller may resubmit the capsule prior to ExitBootServices().
EFI_OUT_OF_RESOURCESWhen ExitBootServices() has not been previously called then this error indicates the capsule is compatible with this platform but there are insufficient resources to process.
EFI_UNSUPPORTEDThis call is not supported by this platform at the time the call is made. The platform should describe this runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE configuration table.

Definition at line 267 of file CapsuleService.c.

◆ UpdateCapsule()

EFI_STATUS EFIAPI UpdateCapsule ( IN EFI_CAPSULE_HEADER **  CapsuleHeaderArray,
IN UINTN  CapsuleCount,
IN EFI_PHYSICAL_ADDRESS ScatterGatherList  OPTIONAL 
)

Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended consumption, the firmware may process the capsule immediately. If the payload should persist across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must be passed into ResetSystem() and will cause the capsule to be processed by the firmware as part of the reset process.

Parameters
CapsuleHeaderArrayVirtual pointer to an array of virtual pointers to the capsules being passed into update capsule.
CapsuleCountNumber of pointers to EFI_CAPSULE_HEADER in CaspuleHeaderArray.
ScatterGatherListPhysical pointer to a set of EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the location in physical memory of a set of capsules.
Return values
EFI_SUCCESSValid capsule was passed. If CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the capsule has been successfully processed by the firmware.
EFI_DEVICE_ERRORThe capsule update was started, but failed due to a device error.
EFI_INVALID_PARAMETERCapsuleSize is NULL, or an incompatible set of flags were set in the capsule header.
EFI_INVALID_PARAMETERCapsuleCount is Zero.
EFI_INVALID_PARAMETERFor across reset capsule image, ScatterGatherList is NULL.
EFI_UNSUPPORTEDCapsuleImage is not recognized by the firmware.
EFI_OUT_OF_RESOURCESWhen ExitBootServices() has been previously called this error indicates the capsule is compatible with this platform but is not capable of being submitted or processed in runtime. The caller may resubmit the capsule prior to ExitBootServices().
EFI_OUT_OF_RESOURCESWhen ExitBootServices() has not been previously called then this error indicates the capsule is compatible with this platform but there are insufficient resources to process.
EFI_UNSUPPORTEDThis call is not supported by this platform at the time the call is made. The platform should describe this runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE configuration table.

Definition at line 63 of file CapsuleService.c.

Variable Documentation

◆ mMaxSizeNonPopulateCapsule

UINT32 mMaxSizeNonPopulateCapsule = 0

Definition at line 25 of file CapsuleService.c.

◆ mMaxSizePopulateCapsule

UINT32 mMaxSizePopulateCapsule = 0

Definition at line 24 of file CapsuleService.c.

◆ mNewHandle

EFI_HANDLE mNewHandle = NULL

Definition at line 17 of file CapsuleService.c.

◆ mTimes

UINTN mTimes = 0

Definition at line 22 of file CapsuleService.c.