X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FDisk%2FCdExpressPei%2FPeiCdExpress.h;h=e5b9c1eaa2d21b6707dab8d01ff348224ef15d54;hb=HEAD;hp=99edd3d5a2b24727d458b7fd46dac62bb6ebb539;hpb=30c00a1cfa4f2b66ca140498daa7d8794f30d5cb;p=mirror_edk2.git
diff --git a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h
index 99edd3d5a2..e5b9c1eaa2 100644
--- a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h
+++ b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h
@@ -1,26 +1,19 @@
/** @file
Header file for CD recovery PEIM
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, 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.
+SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef _PEI_CD_EXPRESS_H_
#define _PEI_CD_EXPRESS_H_
-
#include
#include
+#include
#include
#include
@@ -32,57 +25,51 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include
#include
-
#pragma pack(1)
-#define PEI_CD_EXPRESS_MAX_BLOCK_IO_PPI 8
-#define PEI_CD_EXPRESS_MAX_CAPSULE_NUMBER 16
+#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
-
-//
-// Recovery file name (in root directory)
-//
-#define PEI_RECOVERY_FILE_NAME "FVMAIN.FV"
+#define PEI_CD_BLOCK_SIZE 0x800
+#define PEI_MEMMORY_PAGE_SIZE 0x1000
//
// Following are defined according to ISO-9660 specification
//
-#define PEI_CD_STANDARD_ID "CD001"
-#define PEI_CD_EXPRESS_STANDARD_ID_SIZE 5
+#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_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_VOLUME_TYPE_PRIMARY 1
+#define PEI_CD_EXPRESS_VOLUME_TYPE_TERMINATOR 255
#define PEI_CD_EXPRESS_DIR_FILE_REC_FLAG_ISDIR 0x02
typedef struct {
- UINTN CapsuleStartLBA;
- UINTN CapsuleSize;
- UINTN IndexBlock;
- EFI_PEI_RECOVERY_BLOCK_IO_PPI *BlockIo;
+ UINTN CapsuleStartLBA;
+ UINTN CapsuleSize;
+ UINTN CapsuleBlockAlignedSize;
+ UINTN IndexBlock;
+ EFI_PEI_RECOVERY_BLOCK_IO_PPI *BlockIo;
+ EFI_PEI_RECOVERY_BLOCK_IO2_PPI *BlockIo2;
} PEI_CD_EXPRESS_CAPSULE_DATA;
-#define PEI_CD_EXPRESS_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('p', 'c', 'd', 'e')
+#define PEI_CD_EXPRESS_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('p', 'c', 'd', 'e')
typedef struct {
-
UINTN Signature;
- EFI_PEI_SERVICES **PeiServices;
EFI_PEI_DEVICE_RECOVERY_MODULE_PPI DeviceRecoveryPpi;
EFI_PEI_PPI_DESCRIPTOR PpiDescriptor;
EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor;
+ EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor2;
UINT8 *BlockBuffer;
UINTN CapsuleCount;
PEI_CD_EXPRESS_CAPSULE_DATA CapsuleData[PEI_CD_EXPRESS_MAX_CAPSULE_NUMBER];
-
} PEI_CD_EXPRESS_PRIVATE_DATA;
#define PEI_CD_EXPRESS_PRIVATE_DATA_FROM_THIS(a) \
@@ -93,22 +80,22 @@ typedef struct {
)
typedef struct {
- UINT8 Length;
- UINT8 ExtendedAttributeRecordLength;
- UINT32 LocationOfExtent[2];
- UINT32 DataLength[2];
- UINT8 DateTime[7];
- UINT8 Flag;
- UINT8 FileUnitSize;
- UINT8 InterleaveGapSize;
- UINT32 VolumeSequenceNumber;
- UINT8 FileIDLength;
- UINT8 FileID[1];
+ UINT8 Length;
+ UINT8 ExtendedAttributeRecordLength;
+ UINT32 LocationOfExtent[2];
+ UINT32 DataLength[2];
+ UINT8 DateTime[7];
+ UINT8 Flag;
+ UINT8 FileUnitSize;
+ UINT8 InterleaveGapSize;
+ UINT32 VolumeSequenceNumber;
+ UINT8 FileIDLength;
+ UINT8 FileID[1];
} PEI_CD_EXPRESS_DIR_FILE_RECORD;
/**
- BlockIo installation notification function.
-
+ BlockIo installation notification function.
+
This function finds out all the current Block IO PPIs in the system and add them
into private data.
@@ -131,31 +118,33 @@ BlockIoNotifyEntry (
Finds out all the current Block IO PPIs in the system and add them into private data.
@param PrivateData The private data structure that contains recovery module information.
+ @param BlockIo2 Boolean to show whether using BlockIo2 or BlockIo.
@retval EFI_SUCCESS The blocks and volumes are updated successfully.
**/
EFI_STATUS
UpdateBlocksAndVolumes (
- IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData
+ IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData,
+ IN BOOLEAN BlockIo2
);
/**
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
+ 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.
- @param[in] PeiServices General-purpose services that are available
+ @param[in] PeiServices General-purpose services that are available
to every PEIM
@param[in] This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI
instance.
- @param[out] NumberRecoveryCapsules Pointer to a caller-allocated UINTN. On
- output, *NumberRecoveryCapsules contains
- the number of recovery capsule images
- available for retrieval from this PEIM
+ @param[out] NumberRecoveryCapsules Pointer to a caller-allocated UINTN. On
+ output, *NumberRecoveryCapsules contains
+ the number of recovery capsule images
+ available for retrieval from this PEIM
instance.
@retval EFI_SUCCESS One or more capsules were discovered.
@@ -166,9 +155,9 @@ UpdateBlocksAndVolumes (
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
);
/**
@@ -177,18 +166,18 @@ GetNumberRecoveryCapsules (
This function gets the size and type of the capsule specified by CapsuleInstance.
@param[in] PeiServices General-purpose services that are available to every PEIM
- @param[in] This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI
+ @param[in] This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI
instance.
- @param[in] CapsuleInstance Specifies for which capsule instance to retrieve
- the information. This parameter must be between
- one and the value returned by GetNumberRecoveryCapsules()
+ @param[in] CapsuleInstance Specifies for which capsule instance to retrieve
+ the information. This parameter must be between
+ one and the value returned by GetNumberRecoveryCapsules()
in NumberRecoveryCapsules.
- @param[out] Size A pointer to a caller-allocated UINTN in which
- the size of the requested recovery module is
+ @param[out] Size A pointer to a caller-allocated UINTN in which
+ the size of the requested recovery module is
returned.
- @param[out] CapsuleType A pointer to a caller-allocated EFI_GUID in which
- the type of the requested recovery capsule is
- returned. The semantic meaning of the value
+ @param[out] CapsuleType A 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.
@retval EFI_SUCCESS One or more capsules were discovered.
@@ -199,11 +188,11 @@ 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
);
/**
@@ -212,12 +201,12 @@ GetRecoveryCapsuleInfo (
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.
- @param[in] PeiServices General-purpose services that are available
+ @param[in] PeiServices General-purpose services that are available
to every PEIM
@param[in] This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI
instance.
@param[in] CapsuleInstance Specifies which capsule instance to retrieve.
- @param[out] Buffer Specifies a caller-allocated buffer in which
+ @param[out] Buffer Specifies a caller-allocated buffer in which
the requested recovery capsule will be returned.
@retval EFI_SUCCESS The capsule was loaded correctly.
@@ -228,10 +217,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
);
/**
@@ -246,7 +235,7 @@ LoadRecoveryCapsule (
EFI_STATUS
EFIAPI
FindRecoveryCapsules (
- IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData
+ IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData
);
/**
@@ -254,24 +243,25 @@ FindRecoveryCapsules (
@param PrivateData The private data structure that contains recovery module information.
@param BlockIoPpi The Block IO PPI used to access the volume.
+ @param BlockIo2Ppi The Block IO 2 PPI used to access the volume.
@param IndexBlockDevice The index of current block device.
@param Lba The starting logic block address to retrieve capsule.
@retval EFI_SUCCESS The recovery capsule is successfully found in the volume.
@retval EFI_NOT_FOUND The recovery capsule is not found in the volume.
- @retval Others
+ @retval Others
**/
EFI_STATUS
EFIAPI
RetrieveCapsuleFileFromRoot (
- IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData,
- IN EFI_PEI_RECOVERY_BLOCK_IO_PPI *BlockIoPpi,
- 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
);
-
/**
This function compares two ASCII strings in case sensitive/insensitive way.
@@ -286,10 +276,10 @@ RetrieveCapsuleFileFromRoot (
**/
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
);
#pragma pack()