EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Functions | Variables

MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c File Reference

#include <Uefi.h>
#include <Protocol/Capsule.h>
#include <Guid/CapsuleVendor.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
#include <Library/CapsuleLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiRuntimeLib.h>
#include <Library/BaseLib.h>
#include <Library/PrintLib.h>

Go to the source code of this file.

Functions

VOID SaveLongModeContext (VOID)
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

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 - 2011, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file CapsuleService.c.


Function Documentation

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 338 of file CapsuleService.c.

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().

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.

Definition at line 241 of file CapsuleService.c.

VOID SaveLongModeContext ( VOID  )

Create the variable to save the base address of page table and stack for transferring into long mode in IA32 PEI.

Only when PEI is IA32 and DXE is X64, we need transfer to long mode in PEI in order to process capsule data above 4GB. So create a NULL function here for other cases.

Create the variable to save the base address of page table and stack for transferring into long mode in IA32 capsule PEI.

Definition at line 23 of file SaveLongModeContext.c.

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.

Definition at line 80 of file CapsuleService.c.


Variable Documentation

Definition at line 36 of file CapsuleService.c.

Definition at line 41 of file CapsuleService.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines