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

Go to the source code of this file.

Data Structures

struct  PEI_CD_EXPRESS_CAPSULE_DATA
 
struct  PEI_CD_EXPRESS_PRIVATE_DATA
 
struct  PEI_CD_EXPRESS_DIR_FILE_RECORD
 

Macros

#define PEI_CD_EXPRESS_MAX_BLOCK_IO_PPI   8
 
#define PEI_CD_EXPRESS_MAX_CAPSULE_NUMBER   16
 
#define PEI_CD_BLOCK_SIZE   0x800
 
#define PEI_MEMMORY_PAGE_SIZE   0x1000
 
#define PEI_CD_STANDARD_ID   "CD001"
 
#define PEI_CD_EXPRESS_STANDARD_ID_SIZE   5
 
#define PEI_CD_EXPRESS_VOLUME_TYPE_OFFSET   0
 
#define PEI_CD_EXPRESS_STANDARD_ID_OFFSET   1
 
#define PEI_CD_EXPRESS_VOLUME_SPACE_OFFSET   80
 
#define PEI_CD_EXPRESS_ROOT_DIR_RECORD_OFFSET   156
 
#define PEI_CD_EXPRESS_VOLUME_TYPE_PRIMARY   1
 
#define PEI_CD_EXPRESS_VOLUME_TYPE_TERMINATOR   255
 
#define PEI_CD_EXPRESS_DIR_FILE_REC_FLAG_ISDIR   0x02
 
#define PEI_CD_EXPRESS_PRIVATE_DATA_SIGNATURE   SIGNATURE_32 ('p', 'c', 'd', 'e')
 
#define PEI_CD_EXPRESS_PRIVATE_DATA_FROM_THIS(a)
 

Functions

EFI_STATUS EFIAPI BlockIoNotifyEntry (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
 
EFI_STATUS UpdateBlocksAndVolumes (IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData, IN BOOLEAN BlockIo2)
 
EFI_STATUS EFIAPI GetNumberRecoveryCapsules (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This, OUT UINTN *NumberRecoveryCapsules)
 
EFI_STATUS EFIAPI GetRecoveryCapsuleInfo (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This, IN UINTN CapsuleInstance, OUT UINTN *Size, OUT EFI_GUID *CapsuleType)
 
EFI_STATUS EFIAPI LoadRecoveryCapsule (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This, IN UINTN CapsuleInstance, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI FindRecoveryCapsules (IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData)
 
EFI_STATUS EFIAPI RetrieveCapsuleFileFromRoot (IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData, IN EFI_PEI_RECOVERY_BLOCK_IO_PPI *BlockIoPpi, IN EFI_PEI_RECOVERY_BLOCK_IO2_PPI *BlockIo2Ppi, IN UINTN IndexBlockDevice, IN UINT32 Lba)
 
BOOLEAN StringCmp (IN UINT8 *Source1, IN UINT8 *Source2, IN UINTN Size, IN BOOLEAN CaseSensitive)
 

Detailed Description

Header file for CD recovery PEIM

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PeiCdExpress.h.

Macro Definition Documentation

◆ PEI_CD_BLOCK_SIZE

#define PEI_CD_BLOCK_SIZE   0x800

Definition at line 33 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_DIR_FILE_REC_FLAG_ISDIR

#define PEI_CD_EXPRESS_DIR_FILE_REC_FLAG_ISDIR   0x02

Definition at line 50 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_MAX_BLOCK_IO_PPI

#define PEI_CD_EXPRESS_MAX_BLOCK_IO_PPI   8

Definition at line 30 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_MAX_CAPSULE_NUMBER

#define PEI_CD_EXPRESS_MAX_CAPSULE_NUMBER   16

Definition at line 31 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_PRIVATE_DATA_FROM_THIS

#define PEI_CD_EXPRESS_PRIVATE_DATA_FROM_THIS (   a)
Value:
CR (a, \
DeviceRecoveryPpi, \
PEI_CD_EXPRESS_PRIVATE_DATA_SIGNATURE \
)
#define CR(Record, TYPE, Field, TestSignature)
Definition: DebugLib.h:659

Definition at line 75 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_PRIVATE_DATA_SIGNATURE

#define PEI_CD_EXPRESS_PRIVATE_DATA_SIGNATURE   SIGNATURE_32 ('p', 'c', 'd', 'e')

Definition at line 61 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_ROOT_DIR_RECORD_OFFSET

#define PEI_CD_EXPRESS_ROOT_DIR_RECORD_OFFSET   156

Definition at line 45 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_STANDARD_ID_OFFSET

#define PEI_CD_EXPRESS_STANDARD_ID_OFFSET   1

Definition at line 43 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_STANDARD_ID_SIZE

#define PEI_CD_EXPRESS_STANDARD_ID_SIZE   5

Definition at line 40 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_VOLUME_SPACE_OFFSET

#define PEI_CD_EXPRESS_VOLUME_SPACE_OFFSET   80

Definition at line 44 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_VOLUME_TYPE_OFFSET

#define PEI_CD_EXPRESS_VOLUME_TYPE_OFFSET   0

Definition at line 42 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_VOLUME_TYPE_PRIMARY

#define PEI_CD_EXPRESS_VOLUME_TYPE_PRIMARY   1

Definition at line 47 of file PeiCdExpress.h.

◆ PEI_CD_EXPRESS_VOLUME_TYPE_TERMINATOR

#define PEI_CD_EXPRESS_VOLUME_TYPE_TERMINATOR   255

Definition at line 48 of file PeiCdExpress.h.

◆ PEI_CD_STANDARD_ID

#define PEI_CD_STANDARD_ID   "CD001"

Definition at line 39 of file PeiCdExpress.h.

◆ PEI_MEMMORY_PAGE_SIZE

#define PEI_MEMMORY_PAGE_SIZE   0x1000

Definition at line 34 of file PeiCdExpress.h.

Function Documentation

◆ BlockIoNotifyEntry()

EFI_STATUS EFIAPI BlockIoNotifyEntry ( IN EFI_PEI_SERVICES **  PeiServices,
IN EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor,
IN VOID *  Ppi 
)

BlockIo installation notification function.

This function finds out all the current Block IO PPIs in the system and add them into private data.

Parameters
PeiServicesIndirect reference to the PEI Services Table.
NotifyDescriptorAddress of the notification descriptor data structure.
PpiAddress of the PPI that was installed.
Return values
EFI_SUCCESSThe function completes successfully.

BlockIo installation notification function. Find out all the current BlockIO PPIs in the system and add them into private data. Assume there is

Parameters
PeiServicesGeneral purpose services available to every PEIM.
NotifyDescriptorThe typedef structure of the notification descriptor. Not used in this function.
PpiThe typedef structure of the PPI descriptor. Not used in this function.
Return values
EFI_SUCCESSThe function completed successfully.

Definition at line 214 of file FatLiteApi.c.

◆ FindRecoveryCapsules()

EFI_STATUS EFIAPI FindRecoveryCapsules ( IN OUT PEI_CD_EXPRESS_PRIVATE_DATA PrivateData)

Finds out the recovery capsule in the current volume.

Parameters
PrivateDataThe private data structure that contains recovery module information.
Return values
EFI_SUCCESSThe recovery capsule is successfully found in the volume.
EFI_NOT_FOUNDThe recovery capsule is not found in the volume.

Definition at line 299 of file PeiCdExpress.c.

◆ GetNumberRecoveryCapsules()

EFI_STATUS EFIAPI GetNumberRecoveryCapsules ( IN EFI_PEI_SERVICES **  PeiServices,
IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI This,
OUT UINTN NumberRecoveryCapsules 
)

Returns the number of DXE capsules residing on the device.

This function searches for DXE capsules from the associated device and returns the number and maximum size in bytes of the capsules discovered. Entry 1 is assumed to be the highest load priority and entry N is assumed to be the lowest priority.

Parameters
[in]PeiServicesGeneral-purpose services that are available to every PEIM
[in]ThisIndicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI instance.
[out]NumberRecoveryCapsulesPointer to a caller-allocated UINTN. On output, *NumberRecoveryCapsules contains the number of recovery capsule images available for retrieval from this PEIM instance.
Return values
EFI_SUCCESSOne or more capsules were discovered.
EFI_DEVICE_ERRORA device error occurred.
EFI_NOT_FOUNDA recovery DXE capsule cannot be found.

Definition at line 350 of file FatLiteApi.c.

◆ GetRecoveryCapsuleInfo()

EFI_STATUS EFIAPI GetRecoveryCapsuleInfo ( IN EFI_PEI_SERVICES **  PeiServices,
IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI This,
IN UINTN  CapsuleInstance,
OUT UINTN Size,
OUT EFI_GUID CapsuleType 
)

Returns the size and type of the requested recovery capsule.

This function gets the size and type of the capsule specified by CapsuleInstance.

Parameters
[in]PeiServicesGeneral-purpose services that are available to every PEIM
[in]ThisIndicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI instance.
[in]CapsuleInstanceSpecifies for which capsule instance to retrieve the information. This parameter must be between one and the value returned by GetNumberRecoveryCapsules() in NumberRecoveryCapsules.
[out]SizeA pointer to a caller-allocated UINTN in which the size of the requested recovery module is returned.
[out]CapsuleTypeA pointer to a caller-allocated EFI_GUID in which the type of the requested recovery capsule is returned. The semantic meaning of the value returned is defined by the implementation.
Return values
EFI_SUCCESSOne or more capsules were discovered.
EFI_DEVICE_ERRORA device error occurred.
EFI_NOT_FOUNDA recovery DXE capsule cannot be found.

Definition at line 413 of file FatLiteApi.c.

◆ LoadRecoveryCapsule()

EFI_STATUS EFIAPI LoadRecoveryCapsule ( IN EFI_PEI_SERVICES **  PeiServices,
IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI This,
IN UINTN  CapsuleInstance,
OUT VOID *  Buffer 
)

Loads a DXE capsule from some media into memory.

This function, by whatever mechanism, retrieves a DXE capsule from some device and loads it into memory. Note that the published interface is device neutral.

Parameters
[in]PeiServicesGeneral-purpose services that are available to every PEIM
[in]ThisIndicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI instance.
[in]CapsuleInstanceSpecifies which capsule instance to retrieve.
[out]BufferSpecifies a caller-allocated buffer in which the requested recovery capsule will be returned.
Return values
EFI_SUCCESSThe capsule was loaded correctly.
EFI_DEVICE_ERRORA device error occurred.
EFI_NOT_FOUNDA requested recovery DXE capsule cannot be found.

Definition at line 542 of file FatLiteApi.c.

◆ RetrieveCapsuleFileFromRoot()

EFI_STATUS EFIAPI RetrieveCapsuleFileFromRoot ( IN OUT PEI_CD_EXPRESS_PRIVATE_DATA PrivateData,
IN EFI_PEI_RECOVERY_BLOCK_IO_PPI BlockIoPpi,
IN EFI_PEI_RECOVERY_BLOCK_IO2_PPI BlockIo2Ppi,
IN UINTN  IndexBlockDevice,
IN UINT32  Lba 
)

Retrieves the recovery capsule in root directory of the current volume.

Parameters
PrivateDataThe private data structure that contains recovery module information.
BlockIoPpiThe Block IO PPI used to access the volume.
BlockIo2PpiThe Block IO 2 PPI used to access the volume.
IndexBlockDeviceThe index of current block device.
LbaThe starting logic block address to retrieve capsule.
Return values
EFI_SUCCESSThe recovery capsule is successfully found in the volume.
EFI_NOT_FOUNDThe recovery capsule is not found in the volume.
Others

Definition at line 421 of file PeiCdExpress.c.

◆ StringCmp()

BOOLEAN StringCmp ( IN UINT8 *  Source1,
IN UINT8 *  Source2,
IN UINTN  Size,
IN BOOLEAN  CaseSensitive 
)

This function compares two ASCII strings in case sensitive/insensitive way.

Parameters
Source1The first string.
Source2The second string.
SizeThe maximum comparison length.
CaseSensitiveFlag to indicate whether the comparison is case sensitive.
Return values
TRUEThe two strings are the same.
FALSEThe two string are not the same.

Definition at line 701 of file PeiCdExpress.c.

◆ UpdateBlocksAndVolumes()

EFI_STATUS UpdateBlocksAndVolumes ( IN OUT PEI_CD_EXPRESS_PRIVATE_DATA PrivateData,
IN BOOLEAN  BlockIo2 
)

Finds out all the current Block IO PPIs in the system and add them into private data.

Parameters
PrivateDataThe private data structure that contains recovery module information.
BlockIo2Boolean to show whether using BlockIo2 or BlockIo.
Return values
EFI_SUCCESSThe blocks and volumes are updated successfully.

Definition at line 154 of file PeiCdExpress.c.