TianoCore EDK2 master
|
#include "Capsule.h"
Go to the source code of this file.
Macros | |
#define | DEFAULT_SG_LIST_HEADS (20) |
Functions | |
VOID | SortMemoryResourceDescriptor (IN OUT MEMORY_RESOURCE_DESCRIPTOR *MemoryResource) |
VOID | MergeMemoryResourceDescriptor (IN OUT MEMORY_RESOURCE_DESCRIPTOR *MemoryResource) |
MEMORY_RESOURCE_DESCRIPTOR * | BuildMemoryResourceDescriptor (VOID) |
BOOLEAN | AreCapsulesStaged (VOID) |
EFI_STATUS | GetScatterGatherHeadEntries (OUT UINTN *ListLength, OUT EFI_PHYSICAL_ADDRESS **HeadList) |
EFI_STATUS EFIAPI | CapsuleCoalesce (IN EFI_PEI_SERVICES **PeiServices, IN OUT VOID **MemoryBase, IN OUT UINTN *MemorySize) |
EFI_STATUS EFIAPI | CheckCapsuleUpdate (IN EFI_PEI_SERVICES **PeiServices) |
BOOLEAN | CapsuleTestPattern (IN EFI_PEI_SERVICES **PeiServices, IN VOID *CapsuleBase) |
EFI_STATUS EFIAPI | CreateState (IN EFI_PEI_SERVICES **PeiServices, IN VOID *CapsuleBase, IN UINTN CapsuleSize) |
EFI_STATUS EFIAPI | CapsuleMain (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices) |
Variables | |
CONST EFI_PEI_CAPSULE_PPI | mCapsulePpi |
CONST EFI_PEI_PPI_DESCRIPTOR | mUefiPpiListCapsule |
Capsule update PEIM for UEFI2.0
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Incorporated. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UefiCapsule.c.
#define DEFAULT_SG_LIST_HEADS (20) |
Definition at line 13 of file UefiCapsule.c.
BOOLEAN AreCapsulesStaged | ( | VOID | ) |
Check if the capsules are staged.
TRUE | The capsules are staged. |
FALSE | The capsules are not staged. |
Definition at line 838 of file UefiCapsule.c.
MEMORY_RESOURCE_DESCRIPTOR * BuildMemoryResourceDescriptor | ( | VOID | ) |
Build memory resource descriptor from resource descriptor in HOB list.
Definition at line 731 of file UefiCapsule.c.
EFI_STATUS EFIAPI CapsuleCoalesce | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN OUT VOID ** | MemoryBase, | ||
IN OUT UINTN * | MemorySize | ||
) |
Capsule PPI service to coalesce a fragmented capsule in memory.
PeiServices | General purpose services available to every PEIM. |
MemoryBase | Pointer to the base of a block of memory that we can walk all over while trying to coalesce our buffers. On output, this variable will hold the base address of a coalesced capsule. |
MemorySize | Size of the memory region pointed to by MemoryBase. On output, this variable will contain the size of the coalesced capsule. |
EFI_NOT_FOUND | if we can't determine the boot mode if the boot mode is not flash-update if we could not find the capsule descriptors |
EFI_BUFFER_TOO_SMALL | if we could not coalesce the capsule in the memory region provided to us |
EFI_SUCCESS | if there's no capsule, or if we processed the capsule successfully. |
Definition at line 1066 of file UefiCapsule.c.
EFI_STATUS EFIAPI CapsuleMain | ( | IN EFI_PEI_FILE_HANDLE | FileHandle, |
IN CONST EFI_PEI_SERVICES ** | PeiServices | ||
) |
Entry point function for the PEIM
FileHandle | Handle of the file being invoked. |
PeiServices | Describes the list of possible PEI Services. |
Definition at line 1370 of file UefiCapsule.c.
BOOLEAN CapsuleTestPattern | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN VOID * | CapsuleBase | ||
) |
This function will look at a capsule and determine if it's a test pattern. If it is, then it will verify it and emit an error message if corruption is detected.
PeiServices | Standard pei services pointer |
CapsuleBase | Base address of coalesced capsule, which is preceeded by private data. Very implementation specific. |
TRUE | Capsule image is the test image |
FALSE | Capsule image is not the test image. |
Definition at line 1204 of file UefiCapsule.c.
EFI_STATUS EFIAPI CheckCapsuleUpdate | ( | IN EFI_PEI_SERVICES ** | PeiServices | ) |
Determine if we're in capsule update boot mode.
PeiServices | PEI services table |
EFI_SUCCESS | if we have a capsule available |
EFI_NOT_FOUND | no capsule detected |
Definition at line 1180 of file UefiCapsule.c.
EFI_STATUS EFIAPI CreateState | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN VOID * | CapsuleBase, | ||
IN UINTN | CapsuleSize | ||
) |
Capsule PPI service that gets called after memory is available. The capsule coalesce function, which must be called first, returns a base address and size, which can be anything actually. Once the memory init PEIM has discovered memory, then it should call this function and pass in the base address and size returned by the coalesce function. Then this function can create a capsule HOB and return.
PeiServices | standard pei services pointer |
CapsuleBase | address returned by the capsule coalesce function. Most likely this will actually be a pointer to private data. |
CapsuleSize | value returned by the capsule coalesce function. |
EFI_VOLUME_CORRUPTED | CapsuleBase does not appear to point to a coalesced capsule |
EFI_SUCCESS | if all goes well. |
Definition at line 1269 of file UefiCapsule.c.
EFI_STATUS GetScatterGatherHeadEntries | ( | OUT UINTN * | ListLength, |
OUT EFI_PHYSICAL_ADDRESS ** | HeadList | ||
) |
Check all the variables for SG list heads and get the count and addresses.
ListLength | A pointer would return the SG list length. |
HeadList | A ponter to the capsule SG list. |
EFI_SUCCESS | a valid capsule is present |
EFI_NOT_FOUND | if a valid capsule is not present |
EFI_INVALID_PARAMETER | the input parameter is invalid |
EFI_OUT_OF_RESOURCES | fail to allocate memory |
Definition at line 894 of file UefiCapsule.c.
VOID MergeMemoryResourceDescriptor | ( | IN OUT MEMORY_RESOURCE_DESCRIPTOR * | MemoryResource | ) |
Merge continous memory resource entries.
[in,out] | MemoryResource | A pointer to the memory resource entry buffer. |
Definition at line 685 of file UefiCapsule.c.
VOID SortMemoryResourceDescriptor | ( | IN OUT MEMORY_RESOURCE_DESCRIPTOR * | MemoryResource | ) |
Sort memory resource entries based upon PhysicalStart, from low to high.
[in,out] | MemoryResource | A pointer to the memory resource entry buffer. |
Definition at line 652 of file UefiCapsule.c.
CONST EFI_PEI_CAPSULE_PPI mCapsulePpi |
Definition at line 1347 of file UefiCapsule.c.
CONST EFI_PEI_PPI_DESCRIPTOR mUefiPpiListCapsule |
Definition at line 1353 of file UefiCapsule.c.