Capsule.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
0N/A/** @file
3761N/A Defines the APIs that enable PEI services to work with
0N/A the underlying capsule capabilities of the platform.
0N/A
0N/ACopyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
0N/A
0N/AThis program and the accompanying materials
0N/Aare licensed and made available under the terms and conditions
0N/Aof the BSD License which accompanies this distribution. The
0N/Afull text of the license may be found at
0N/Ahttp://opensource.org/licenses/bsd-license.php
0N/A
0N/ATHE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
0N/AWITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
0N/A
0N/A**/
0N/A
0N/A#ifndef _PEI_CAPSULE_PPI_H_
1472N/A#define _PEI_CAPSULE_PPI_H_
1472N/A
1472N/A///
0N/A/// Global ID for the PEI_CAPSULE_PPI.
0N/A///
0N/A#define PEI_CAPSULE_PPI_GUID \
1879N/A { \
1879N/A 0x3acf33ee, 0xd892, 0x40f4, {0xa2, 0xfc, 0x38, 0x54, 0xd2, 0xe1, 0x32, 0x3d } \
1879N/A }
0N/A
0N/A///
0N/A/// Forward declaration for the PEI_CAPSULE_PPI.
0N/A///
0N/Atypedef struct _PEI_CAPSULE_PPI PEI_CAPSULE_PPI;
0N/A
0N/A/**
0N/A Upon determining that there is a capsule to operate on, this service
0N/A will use a series of EFI_CAPSULE_BLOCK_DESCRIPTOR entries to determine
0N/A the current location of the various capsule fragments and coalesce them
3761N/A into a contiguous region of system memory.
0N/A
0N/A @param[in] PeiServices Pointer to the PEI Services Table.
0N/A @param[out] MemoryBase Pointer to the base of a block of memory into which the buffers will be coalesced.
0N/A On output, this variable will hold the base address
0N/A of a coalesced capsule.
0N/A @param[out] MemorySize Size of the memory region pointed to by MemoryBase.
0N/A On output, this variable will contain the size of the
0N/A coalesced capsule.
0N/A
0N/A @retval EFI_NOT_FOUND If: boot modecould not be determined, or the
0N/A boot mode is not flash-update, or the capsule descriptors were not found.
0N/A @retval EFI_BUFFER_TOO_SMALL The capsule could not be coalesced in the provided memory region.
0N/A @retval EFI_SUCCESS There was no capsule, or the capsule was processed successfully.
0N/A
0N/A**/
0N/Atypedef
0N/AEFI_STATUS
0N/A(EFIAPI *PEI_CAPSULE_COALESCE)(
0N/A IN EFI_PEI_SERVICES **PeiServices,
1879N/A IN OUT VOID **MemoryBase,
1879N/A IN OUT UINTN *MemSize
);
/**
Determine if a capsule needs to be processed.
The means by which the presence of a capsule is determined is platform
specific. For example, an implementation could be driven by the presence
of a Capsule EFI Variable containing a list of EFI_CAPSULE_BLOCK_DESCRIPTOR
entries. If present, return EFI_SUCCESS, otherwise return EFI_NOT_FOUND.
@param[in] PeiServices Pointer to the PEI Services Table.
@retval EFI_SUCCESS If a capsule is available.
@retval EFI_NOT_FOUND No capsule detected.
**/
typedef
EFI_STATUS
(EFIAPI *PEI_CAPSULE_CHECK_CAPSULE_UPDATE)(
IN EFI_PEI_SERVICES **PeiServices
);
/**
The 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. Once the memory init PEIM has discovered memory,
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.
@par Notes:
This function assumes it will not be called until the
actual capsule update.
@param[in] PeiServices Pointer to the PEI Services Table.
@param[in] CapsuleBase Address returned by the capsule coalesce function.
@param[in] CapsuleSize Value returned by the capsule coalesce function.
@retval EFI_VOLUME_CORRUPTED CapsuleBase does not appear to point to a
coalesced capsule.
@retval EFI_SUCCESS Capsule HOB was created successfully.
**/
typedef
EFI_STATUS
(EFIAPI *PEI_CAPSULE_CREATE_STATE)(
IN EFI_PEI_SERVICES **PeiServices,
IN VOID *CapsuleBase,
IN UINTN CapsuleSize
);
///
/// This PPI provides several services in PEI to work with the underlying
/// capsule capabilities of the platform. These services include the ability
/// for PEI to coalesce a capsule from a scattered set of memory locations
/// into a contiguous space in memory, detect if a capsule is present for
/// processing, and once memory is available, create a HOB for the capsule.
///
struct _PEI_CAPSULE_PPI {
PEI_CAPSULE_COALESCE Coalesce;
PEI_CAPSULE_CHECK_CAPSULE_UPDATE CheckCapsuleUpdate;
PEI_CAPSULE_CREATE_STATE CreateState;
};
extern EFI_GUID gPeiCapsulePpiGuid;
#endif // #ifndef _PEI_CAPSULE_PPI_H_