diff options
Diffstat (limited to 'MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c')
-rw-r--r-- | MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c | 298 |
1 files changed, 155 insertions, 143 deletions
diff --git a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c index 242dbf8eb1..6a84f9efd1 100644 --- a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c +++ b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c @@ -9,9 +9,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include "PeiCdExpress.h"
-PEI_CD_EXPRESS_PRIVATE_DATA *mPrivateData = NULL;
-CHAR8 *mRecoveryFileName;
-UINTN mRecoveryFileNameSize;
+PEI_CD_EXPRESS_PRIVATE_DATA *mPrivateData = NULL;
+CHAR8 *mRecoveryFileName;
+UINTN mRecoveryFileNameSize;
/**
Installs the Device Recovery Module PPI, Initialize BlockIo Ppi
@@ -27,12 +27,12 @@ UINTN mRecoveryFileNameSize; EFI_STATUS
EFIAPI
CdExpressPeimEntry (
- IN EFI_PEI_FILE_HANDLE FileHandle,
- IN CONST EFI_PEI_SERVICES **PeiServices
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ IN CONST EFI_PEI_SERVICES **PeiServices
)
{
- EFI_STATUS Status;
- PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData;
+ EFI_STATUS Status;
+ PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData;
if (!EFI_ERROR (PeiServicesRegisterForShadow (FileHandle))) {
return EFI_SUCCESS;
@@ -43,13 +43,14 @@ CdExpressPeimEntry ( return EFI_OUT_OF_RESOURCES;
}
- mRecoveryFileNameSize = PcdGetSize(PcdRecoveryFileName) / sizeof(CHAR16);
- mRecoveryFileName = AllocatePool(mRecoveryFileNameSize);
+ mRecoveryFileNameSize = PcdGetSize (PcdRecoveryFileName) / sizeof (CHAR16);
+ mRecoveryFileName = AllocatePool (mRecoveryFileNameSize);
if (mRecoveryFileName == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- Status = UnicodeStrToAsciiStrS(PcdGetPtr(PcdRecoveryFileName), mRecoveryFileName, mRecoveryFileNameSize);
- if (EFI_ERROR(Status)) {
+
+ Status = UnicodeStrToAsciiStrS (PcdGetPtr (PcdRecoveryFileName), mRecoveryFileName, mRecoveryFileNameSize);
+ if (EFI_ERROR (Status)) {
return Status;
}
@@ -57,23 +58,23 @@ CdExpressPeimEntry ( // Initialize Private Data (to zero, as is required by subsequent operations)
//
ZeroMem (PrivateData, sizeof (*PrivateData));
- PrivateData->Signature = PEI_CD_EXPRESS_PRIVATE_DATA_SIGNATURE;
+ PrivateData->Signature = PEI_CD_EXPRESS_PRIVATE_DATA_SIGNATURE;
- PrivateData->BlockBuffer = AllocatePages (EFI_SIZE_TO_PAGES (PEI_CD_BLOCK_SIZE));
+ PrivateData->BlockBuffer = AllocatePages (EFI_SIZE_TO_PAGES (PEI_CD_BLOCK_SIZE));
if (PrivateData->BlockBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
PrivateData->CapsuleCount = 0;
- Status = UpdateBlocksAndVolumes (PrivateData, TRUE);
- Status = UpdateBlocksAndVolumes (PrivateData, FALSE);
+ Status = UpdateBlocksAndVolumes (PrivateData, TRUE);
+ Status = UpdateBlocksAndVolumes (PrivateData, FALSE);
//
// Installs Ppi
//
- PrivateData->DeviceRecoveryPpi.GetNumberRecoveryCapsules = GetNumberRecoveryCapsules;
- PrivateData->DeviceRecoveryPpi.GetRecoveryCapsuleInfo = GetRecoveryCapsuleInfo;
- PrivateData->DeviceRecoveryPpi.LoadRecoveryCapsule = LoadRecoveryCapsule;
+ PrivateData->DeviceRecoveryPpi.GetNumberRecoveryCapsules = GetNumberRecoveryCapsules;
+ PrivateData->DeviceRecoveryPpi.GetRecoveryCapsuleInfo = GetRecoveryCapsuleInfo;
+ PrivateData->DeviceRecoveryPpi.LoadRecoveryCapsule = LoadRecoveryCapsule;
PrivateData->PpiDescriptor.Flags = (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST);
PrivateData->PpiDescriptor.Guid = &gEfiPeiDeviceRecoveryModulePpiGuid;
@@ -83,6 +84,7 @@ CdExpressPeimEntry ( if (EFI_ERROR (Status)) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// PrivateData is allocated now, set it to the module variable
//
@@ -93,21 +95,20 @@ CdExpressPeimEntry ( //
PrivateData->NotifyDescriptor.Flags =
(
- EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK
+ EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK
);
- PrivateData->NotifyDescriptor.Guid = &gEfiPeiVirtualBlockIoPpiGuid;
- PrivateData->NotifyDescriptor.Notify = BlockIoNotifyEntry;
+ PrivateData->NotifyDescriptor.Guid = &gEfiPeiVirtualBlockIoPpiGuid;
+ PrivateData->NotifyDescriptor.Notify = BlockIoNotifyEntry;
PrivateData->NotifyDescriptor2.Flags =
(
- EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK |
- EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
+ EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK |
+ EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
);
- PrivateData->NotifyDescriptor2.Guid = &gEfiPeiVirtualBlockIo2PpiGuid;
- PrivateData->NotifyDescriptor2.Notify = BlockIoNotifyEntry;
+ PrivateData->NotifyDescriptor2.Guid = &gEfiPeiVirtualBlockIo2PpiGuid;
+ PrivateData->NotifyDescriptor2.Notify = BlockIoNotifyEntry;
return PeiServicesNotifyPpi (&PrivateData->NotifyDescriptor);
-
}
/**
@@ -151,8 +152,8 @@ BlockIoNotifyEntry ( **/
EFI_STATUS
UpdateBlocksAndVolumes (
- IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData,
- IN BOOLEAN BlockIo2
+ IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData,
+ IN BOOLEAN BlockIo2
)
{
EFI_STATUS Status;
@@ -176,19 +177,20 @@ UpdateBlocksAndVolumes ( for (BlockIoPpiInstance = 0; BlockIoPpiInstance < PEI_CD_EXPRESS_MAX_BLOCK_IO_PPI; BlockIoPpiInstance++) {
if (BlockIo2) {
Status = PeiServicesLocatePpi (
- &gEfiPeiVirtualBlockIo2PpiGuid,
- BlockIoPpiInstance,
- &TempPpiDescriptor,
- (VOID **) &BlockIo2Ppi
- );
+ &gEfiPeiVirtualBlockIo2PpiGuid,
+ BlockIoPpiInstance,
+ &TempPpiDescriptor,
+ (VOID **)&BlockIo2Ppi
+ );
} else {
Status = PeiServicesLocatePpi (
- &gEfiPeiVirtualBlockIoPpiGuid,
- BlockIoPpiInstance,
- &TempPpiDescriptor,
- (VOID **) &BlockIoPpi
- );
+ &gEfiPeiVirtualBlockIoPpiGuid,
+ BlockIoPpiInstance,
+ &TempPpiDescriptor,
+ (VOID **)&BlockIoPpi
+ );
}
+
if (EFI_ERROR (Status)) {
//
// Done with all Block Io Ppis
@@ -196,7 +198,7 @@ UpdateBlocksAndVolumes ( break;
}
- PeiServices = (EFI_PEI_SERVICES **) GetPeiServicesTablePointer ();
+ PeiServices = (EFI_PEI_SERVICES **)GetPeiServicesTablePointer ();
if (BlockIo2) {
Status = BlockIo2Ppi->GetNumberOfBlockDevices (
PeiServices,
@@ -205,18 +207,20 @@ UpdateBlocksAndVolumes ( );
} else {
Status = BlockIoPpi->GetNumberOfBlockDevices (
- PeiServices,
- BlockIoPpi,
- &NumberBlockDevices
- );
+ PeiServices,
+ BlockIoPpi,
+ &NumberBlockDevices
+ );
}
+
if (EFI_ERROR (Status) || (NumberBlockDevices == 0)) {
continue;
}
+
//
// Just retrieve the first block, should emulate all blocks.
//
- for (IndexBlockDevice = 1; IndexBlockDevice <= NumberBlockDevices && PrivateData->CapsuleCount < PEI_CD_EXPRESS_MAX_CAPSULE_NUMBER; IndexBlockDevice ++) {
+ for (IndexBlockDevice = 1; IndexBlockDevice <= NumberBlockDevices && PrivateData->CapsuleCount < PEI_CD_EXPRESS_MAX_CAPSULE_NUMBER; IndexBlockDevice++) {
if (BlockIo2) {
Status = BlockIo2Ppi->GetBlockDeviceMediaInfo (
PeiServices,
@@ -226,28 +230,32 @@ UpdateBlocksAndVolumes ( );
if (EFI_ERROR (Status) ||
!Media2.MediaPresent ||
- ((Media2.InterfaceType != MSG_ATAPI_DP) && (Media2.InterfaceType != MSG_USB_DP)) ||
+ ((Media2.InterfaceType != MSG_ATAPI_DP) && (Media2.InterfaceType != MSG_USB_DP)) ||
(Media2.BlockSize != PEI_CD_BLOCK_SIZE)
- ) {
+ )
+ {
continue;
}
+
DEBUG ((DEBUG_INFO, "PeiCdExpress InterfaceType is %d\n", Media2.InterfaceType));
DEBUG ((DEBUG_INFO, "PeiCdExpress MediaPresent is %d\n", Media2.MediaPresent));
DEBUG ((DEBUG_INFO, "PeiCdExpress BlockSize is 0x%x\n", Media2.BlockSize));
} else {
Status = BlockIoPpi->GetBlockDeviceMediaInfo (
- PeiServices,
- BlockIoPpi,
- IndexBlockDevice,
- &Media
- );
+ PeiServices,
+ BlockIoPpi,
+ IndexBlockDevice,
+ &Media
+ );
if (EFI_ERROR (Status) ||
!Media.MediaPresent ||
- ((Media.DeviceType != IdeCDROM) && (Media.DeviceType != UsbMassStorage)) ||
+ ((Media.DeviceType != IdeCDROM) && (Media.DeviceType != UsbMassStorage)) ||
(Media.BlockSize != PEI_CD_BLOCK_SIZE)
- ) {
+ )
+ {
continue;
}
+
DEBUG ((DEBUG_INFO, "PeiCdExpress DeviceType is %d\n", Media.DeviceType));
DEBUG ((DEBUG_INFO, "PeiCdExpress MediaPresent is %d\n", Media.MediaPresent));
DEBUG ((DEBUG_INFO, "PeiCdExpress BlockSize is 0x%x\n", Media.BlockSize));
@@ -260,8 +268,9 @@ UpdateBlocksAndVolumes ( if (BlockIo2) {
PrivateData->CapsuleData[PrivateData->CapsuleCount].BlockIo2 = BlockIo2Ppi;
} else {
- PrivateData->CapsuleData[PrivateData->CapsuleCount].BlockIo = BlockIoPpi;
+ PrivateData->CapsuleData[PrivateData->CapsuleCount].BlockIo = BlockIoPpi;
}
+
Status = FindRecoveryCapsules (PrivateData);
DEBUG ((DEBUG_INFO, "Status is %d\n", Status));
@@ -271,7 +280,6 @@ UpdateBlocksAndVolumes ( PrivateData->CapsuleCount++;
}
-
}
return EFI_SUCCESS;
@@ -289,7 +297,7 @@ UpdateBlocksAndVolumes ( EFI_STATUS
EFIAPI
FindRecoveryCapsules (
- IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData
+ IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData
)
{
EFI_STATUS Status;
@@ -307,10 +315,10 @@ FindRecoveryCapsules ( UINTN OriginalLBA;
UINTN IndexBlockDevice;
- Buffer = PrivateData->BlockBuffer;
- BufferSize = PEI_CD_BLOCK_SIZE;
+ Buffer = PrivateData->BlockBuffer;
+ BufferSize = PEI_CD_BLOCK_SIZE;
- Lba = 16;
+ Lba = 16;
//
// The volume descriptor starts on Lba 16
//
@@ -326,29 +334,30 @@ FindRecoveryCapsules ( SetMem (Buffer, BufferSize, 0);
if (BlockIo2Ppi != NULL) {
Status = BlockIo2Ppi->ReadBlocks (
- (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),
- BlockIo2Ppi,
- IndexBlockDevice,
- Lba,
- BufferSize,
- Buffer
- );
+ (EFI_PEI_SERVICES **)GetPeiServicesTablePointer (),
+ BlockIo2Ppi,
+ IndexBlockDevice,
+ Lba,
+ BufferSize,
+ Buffer
+ );
} else {
Status = BlockIoPpi->ReadBlocks (
- (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),
- BlockIoPpi,
- IndexBlockDevice,
- Lba,
- BufferSize,
- Buffer
- );
+ (EFI_PEI_SERVICES **)GetPeiServicesTablePointer (),
+ BlockIoPpi,
+ IndexBlockDevice,
+ Lba,
+ BufferSize,
+ Buffer
+ );
}
+
if (EFI_ERROR (Status)) {
return Status;
}
- StandardID = (UINT8 *) (Buffer + PEI_CD_EXPRESS_STANDARD_ID_OFFSET);
- if (!StringCmp (StandardID, (UINT8 *) PEI_CD_STANDARD_ID, PEI_CD_EXPRESS_STANDARD_ID_SIZE, TRUE)) {
+ StandardID = (UINT8 *)(Buffer + PEI_CD_EXPRESS_STANDARD_ID_OFFSET);
+ if (!StringCmp (StandardID, (UINT8 *)PEI_CD_STANDARD_ID, PEI_CD_EXPRESS_STANDARD_ID_SIZE, TRUE)) {
break;
}
@@ -357,7 +366,7 @@ FindRecoveryCapsules ( StartOfVolume = FALSE;
}
- Type = *(UINT8 *) (Buffer + PEI_CD_EXPRESS_VOLUME_TYPE_OFFSET);
+ Type = *(UINT8 *)(Buffer + PEI_CD_EXPRESS_VOLUME_TYPE_OFFSET);
if (Type == PEI_CD_EXPRESS_VOLUME_TYPE_TERMINATOR) {
if (VolumeSpaceSize == 0) {
break;
@@ -374,12 +383,12 @@ FindRecoveryCapsules ( continue;
}
- VolumeSpaceSize = *(UINT32 *) (Buffer + PEI_CD_EXPRESS_VOLUME_SPACE_OFFSET);
+ VolumeSpaceSize = *(UINT32 *)(Buffer + PEI_CD_EXPRESS_VOLUME_SPACE_OFFSET);
- RoorDirRecord = (PEI_CD_EXPRESS_DIR_FILE_RECORD *) (Buffer + PEI_CD_EXPRESS_ROOT_DIR_RECORD_OFFSET);
- RootDirLBA = RoorDirRecord->LocationOfExtent[0];
+ RoorDirRecord = (PEI_CD_EXPRESS_DIR_FILE_RECORD *)(Buffer + PEI_CD_EXPRESS_ROOT_DIR_RECORD_OFFSET);
+ RootDirLBA = RoorDirRecord->LocationOfExtent[0];
- Status = RetrieveCapsuleFileFromRoot (PrivateData, BlockIoPpi, BlockIo2Ppi, IndexBlockDevice, RootDirLBA);
+ Status = RetrieveCapsuleFileFromRoot (PrivateData, BlockIoPpi, BlockIo2Ppi, IndexBlockDevice, RootDirLBA);
if (!EFI_ERROR (Status)) {
//
// Just look for the first primary descriptor
@@ -410,11 +419,11 @@ FindRecoveryCapsules ( 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
+ 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
)
{
EFI_STATUS Status;
@@ -423,40 +432,42 @@ RetrieveCapsuleFileFromRoot ( PEI_CD_EXPRESS_DIR_FILE_RECORD *FileRecord;
UINTN Index;
- Buffer = PrivateData->BlockBuffer;
- BufferSize = PEI_CD_BLOCK_SIZE;
+ Buffer = PrivateData->BlockBuffer;
+ BufferSize = PEI_CD_BLOCK_SIZE;
SetMem (Buffer, BufferSize, 0);
if (BlockIo2Ppi != NULL) {
Status = BlockIo2Ppi->ReadBlocks (
- (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),
- BlockIo2Ppi,
- IndexBlockDevice,
- Lba,
- BufferSize,
- Buffer
- );
+ (EFI_PEI_SERVICES **)GetPeiServicesTablePointer (),
+ BlockIo2Ppi,
+ IndexBlockDevice,
+ Lba,
+ BufferSize,
+ Buffer
+ );
} else {
Status = BlockIoPpi->ReadBlocks (
- (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),
- BlockIoPpi,
- IndexBlockDevice,
- Lba,
- BufferSize,
- Buffer
- );
+ (EFI_PEI_SERVICES **)GetPeiServicesTablePointer (),
+ BlockIoPpi,
+ IndexBlockDevice,
+ Lba,
+ BufferSize,
+ Buffer
+ );
}
+
if (EFI_ERROR (Status)) {
return Status;
}
while (1) {
- FileRecord = (PEI_CD_EXPRESS_DIR_FILE_RECORD *) Buffer;
+ FileRecord = (PEI_CD_EXPRESS_DIR_FILE_RECORD *)Buffer;
if (FileRecord->Length == 0) {
break;
}
+
//
// Not intend to check other flag now
//
@@ -481,12 +492,12 @@ RetrieveCapsuleFileFromRoot ( continue;
}
- PrivateData->CapsuleData[PrivateData->CapsuleCount].CapsuleStartLBA = FileRecord->LocationOfExtent[0];
+ PrivateData->CapsuleData[PrivateData->CapsuleCount].CapsuleStartLBA = FileRecord->LocationOfExtent[0];
PrivateData->CapsuleData[PrivateData->CapsuleCount].CapsuleBlockAlignedSize =
(
- FileRecord->DataLength[0] /
- PEI_CD_BLOCK_SIZE +
- 1
+ FileRecord->DataLength[0] /
+ PEI_CD_BLOCK_SIZE +
+ 1
) *
PEI_CD_BLOCK_SIZE;
PrivateData->CapsuleData[PrivateData->CapsuleCount].CapsuleSize = FileRecord->DataLength[0];
@@ -523,12 +534,12 @@ RetrieveCapsuleFileFromRoot ( EFI_STATUS
EFIAPI
GetNumberRecoveryCapsules (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
- OUT UINTN *NumberRecoveryCapsules
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
+ OUT UINTN *NumberRecoveryCapsules
)
{
- PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData;
+ PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData;
PrivateData = PEI_CD_EXPRESS_PRIVATE_DATA_FROM_THIS (This);
UpdateBlocksAndVolumes (PrivateData, TRUE);
@@ -570,16 +581,16 @@ GetNumberRecoveryCapsules ( 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
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
+ IN UINTN CapsuleInstance,
+ OUT UINTN *Size,
+ OUT EFI_GUID *CapsuleType
)
{
- PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData;
- UINTN NumberRecoveryCapsules;
- EFI_STATUS Status;
+ PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData;
+ UINTN NumberRecoveryCapsules;
+ EFI_STATUS Status;
Status = GetNumberRecoveryCapsules (PeiServices, This, &NumberRecoveryCapsules);
@@ -625,10 +636,10 @@ GetRecoveryCapsuleInfo ( EFI_STATUS
EFIAPI
LoadRecoveryCapsule (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
- IN UINTN CapsuleInstance,
- OUT VOID *Buffer
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
+ IN UINTN CapsuleInstance,
+ OUT VOID *Buffer
)
{
EFI_STATUS Status;
@@ -653,23 +664,24 @@ LoadRecoveryCapsule ( if (BlockIo2Ppi != NULL) {
Status = BlockIo2Ppi->ReadBlocks (
- PeiServices,
- BlockIo2Ppi,
- PrivateData->CapsuleData[CapsuleInstance - 1].IndexBlock,
- PrivateData->CapsuleData[CapsuleInstance - 1].CapsuleStartLBA,
- PrivateData->CapsuleData[CapsuleInstance - 1].CapsuleBlockAlignedSize,
- Buffer
- );
+ PeiServices,
+ BlockIo2Ppi,
+ PrivateData->CapsuleData[CapsuleInstance - 1].IndexBlock,
+ PrivateData->CapsuleData[CapsuleInstance - 1].CapsuleStartLBA,
+ PrivateData->CapsuleData[CapsuleInstance - 1].CapsuleBlockAlignedSize,
+ Buffer
+ );
} else {
Status = BlockIoPpi->ReadBlocks (
- PeiServices,
- BlockIoPpi,
- PrivateData->CapsuleData[CapsuleInstance - 1].IndexBlock,
- PrivateData->CapsuleData[CapsuleInstance - 1].CapsuleStartLBA,
- PrivateData->CapsuleData[CapsuleInstance - 1].CapsuleBlockAlignedSize,
- Buffer
- );
+ PeiServices,
+ BlockIoPpi,
+ PrivateData->CapsuleData[CapsuleInstance - 1].IndexBlock,
+ PrivateData->CapsuleData[CapsuleInstance - 1].CapsuleStartLBA,
+ PrivateData->CapsuleData[CapsuleInstance - 1].CapsuleBlockAlignedSize,
+ Buffer
+ );
}
+
return Status;
}
@@ -687,14 +699,14 @@ LoadRecoveryCapsule ( **/
BOOLEAN
StringCmp (
- IN UINT8 *Source1,
- IN UINT8 *Source2,
- IN UINTN Size,
- IN BOOLEAN CaseSensitive
+ IN UINT8 *Source1,
+ IN UINT8 *Source2,
+ IN UINTN Size,
+ IN BOOLEAN CaseSensitive
)
{
- UINTN Index;
- UINT8 Dif;
+ UINTN Index;
+ UINT8 Dif;
for (Index = 0; Index < Size; Index++) {
if (Source1[Index] == Source2[Index]) {
@@ -702,7 +714,7 @@ StringCmp ( }
if (!CaseSensitive) {
- Dif = (UINT8) ((Source1[Index] > Source2[Index]) ? (Source1[Index] - Source2[Index]) : (Source2[Index] - Source1[Index]));
+ Dif = (UINT8)((Source1[Index] > Source2[Index]) ? (Source1[Index] - Source2[Index]) : (Source2[Index] - Source1[Index]));
if (Dif == ('a' - 'A')) {
continue;
}
|