/** @file\r
Data structures for FAT recovery PEIM\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
\r
#include <Guid/RecoveryDevice.h>\r
#include <Ppi/BlockIo.h>\r
+#include <Ppi/BlockIo2.h>\r
#include <Ppi/DeviceRecoveryModule.h>\r
\r
#include <Library/DebugLib.h>\r
//\r
// Definitions\r
//\r
-#define PEI_FAT_RECOVERY_CAPSULE_WITH_NT_EMULATOR L"fv0001.fv"\r
-#define PEI_FAT_RECOVERY_CAPSULE_WITHOUT_NT_EMULATOR L"fvmain.fv"\r
\r
#define PEI_FAT_CACHE_SIZE 4\r
#define PEI_FAT_MAX_BLOCK_SIZE 8192\r
// Following fields only valid for physical device\r
//\r
EFI_PEI_BLOCK_DEVICE_TYPE DevType;\r
+ UINT8 InterfaceType;\r
//\r
// EFI_PEI_READ_BLOCKS ReadFunc;\r
//\r
- EFI_PEI_RECOVERY_BLOCK_IO_PPI *BlockIo;\r
- UINT8 PhysicalDevNo;\r
+ EFI_PEI_RECOVERY_BLOCK_IO_PPI *BlockIo;\r
+ EFI_PEI_RECOVERY_BLOCK_IO2_PPI *BlockIo2;\r
+ UINT8 PhysicalDevNo;\r
} PEI_FAT_BLOCK_DEVICE;\r
\r
//\r
UINTN Signature;\r
EFI_PEI_DEVICE_RECOVERY_MODULE_PPI DeviceRecoveryPpi;\r
EFI_PEI_PPI_DESCRIPTOR PpiDescriptor;\r
- EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor;\r
+ EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor[2];\r
\r
UINT8 UnicodeCaseMap[0x300];\r
CHAR8 *EngUpperMap;\r
This function finds the the recovery file named FileName on a specified FAT volume and returns\r
its FileHandle pointer.\r
\r
- @param PrivateData Global memory map for accessing global \r
- variables. \r
- @param VolumeIndex The index of the volume. \r
- @param FileName The recovery file name to find. \r
- @param Handle The output file handle. \r
+ @param PrivateData Global memory map for accessing global\r
+ variables.\r
+ @param VolumeIndex The index of the volume.\r
+ @param FileName The recovery file name to find.\r
+ @param Handle The output file handle.\r
\r
- @retval EFI_DEVICE_ERROR Some error occured when operating the FAT \r
- volume. \r
- @retval EFI_NOT_FOUND The recovery file was not found. \r
- @retval EFI_SUCCESS The recovery file was successfully found on the \r
+ @retval EFI_DEVICE_ERROR Some error occured when operating the FAT\r
+ volume.\r
+ @retval EFI_NOT_FOUND The recovery file was not found.\r
+ @retval EFI_SUCCESS The recovery file was successfully found on the\r
FAT volume.\r
\r
**/\r
returns the number and maximum size in bytes of the capsules discovered.Entry 1 is assumed to be\r
the highest load priority and entry N is assumed to be the lowest priority.\r
\r
- @param PeiServices General-purpose services that are available to \r
- every PEIM. \r
- @param This Indicates the \r
- EFI_PEI_DEVICE_RECOVERY_MODULE_PPI instance. \r
- @param NumberRecoveryCapsules Pointer to a caller-allocated UINTN.On output, \r
- *NumberRecoveryCapsules contains the number of \r
- recovery capsule images available for retrieval \r
- from this PEIM instance. \r
+ @param PeiServices General-purpose services that are available to\r
+ every PEIM.\r
+ @param This Indicates the\r
+ EFI_PEI_DEVICE_RECOVERY_MODULE_PPI instance.\r
+ @param NumberRecoveryCapsules Pointer to a caller-allocated UINTN.On output,\r
+ *NumberRecoveryCapsules contains the number of\r
+ recovery capsule images available for retrieval\r
+ from this PEIM instance.\r
\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
Returns the size and type of the requested recovery capsule.\r
This function returns the size and type of the capsule specified by CapsuleInstance.\r
\r
- @param PeiServices General-purpose services that are available to \r
- every PEIM. \r
- @param This Indicates the \r
- EFI_PEI_DEVICE_RECOVERY_MODULE_PPI instance. \r
- @param CapsuleInstance Specifies for which capsule instance to \r
- retrieve the information.T his parameter must \r
- be between one and the value returned by \r
- GetNumberRecoveryCapsules() in \r
- NumberRecoveryCapsules. \r
- @param Size A pointer to a caller-allocated UINTN in which \r
- the size of the requested recovery module is \r
- returned. \r
- @param CapsuleType A pointer to a caller-allocated EFI_GUID in \r
- which the type of the requested recovery \r
- capsule is returned.T he semantic meaning of \r
- the value returned is defined by the \r
- implementation. \r
-\r
- @retval EFI_SUCCESS The capsule type and size were retrieved. \r
- @retval EFI_INVALID_PARAMETER The input CapsuleInstance does not match any \r
+ @param PeiServices General-purpose services that are available to\r
+ every PEIM.\r
+ @param This Indicates the\r
+ EFI_PEI_DEVICE_RECOVERY_MODULE_PPI instance.\r
+ @param CapsuleInstance Specifies for which capsule instance to\r
+ retrieve the information.T his parameter must\r
+ be between one and the value returned by\r
+ GetNumberRecoveryCapsules() in\r
+ NumberRecoveryCapsules.\r
+ @param Size A pointer to a caller-allocated UINTN in which\r
+ the size of the requested recovery module is\r
+ returned.\r
+ @param CapsuleType A pointer to a caller-allocated EFI_GUID in\r
+ which the type of the requested recovery\r
+ capsule is returned.T he semantic meaning of\r
+ the value returned is defined by the\r
+ implementation.\r
+\r
+ @retval EFI_SUCCESS The capsule type and size were retrieved.\r
+ @retval EFI_INVALID_PARAMETER The input CapsuleInstance does not match any\r
discovered recovery capsule.\r
\r
**/\r
This function, by whatever mechanism, retrieves a DXE capsule from some device\r
and loads it into memory. Note that the published interface is device neutral.\r
\r
- @param[in] PeiServices General-purpose services that are available \r
+ @param[in] PeiServices General-purpose services that are available\r
to every PEIM\r
@param[in] This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI\r
instance.\r
@param[in] CapsuleInstance Specifies which capsule instance to retrieve.\r
- @param[out] Buffer Specifies a caller-allocated buffer in which \r
+ @param[out] Buffer Specifies a caller-allocated buffer in which\r
the requested recovery capsule will be returned.\r
\r
@retval EFI_SUCCESS The capsule was loaded correctly.\r
to a Null-terminated Unicode string.\r
Here does not expand DBCS FAT chars.\r
\r
- @param FatSize The size of the string Fat in bytes. \r
- @param Fat A pointer to a Null-terminated string that contains \r
- an 8.3 file name using an OEM character set. \r
- @param Str A pointer to a Null-terminated Unicode string. The \r
- string must be allocated in advance to hold FatSize \r
+ @param FatSize The size of the string Fat in bytes.\r
+ @param Fat A pointer to a Null-terminated string that contains\r
+ an 8.3 file name using an OEM character set.\r
+ @param Str A pointer to a Null-terminated Unicode string. The\r
+ string must be allocated in advance to hold FatSize\r
Unicode characters\r
\r
**/\r
/**\r
Performs a case-insensitive comparison of two Null-terminated Unicode strings.\r
\r
- @param PrivateData Global memory map for accessing global variables \r
- @param Str1 First string to perform case insensitive comparison. \r
+ @param PrivateData Global memory map for accessing global variables\r
+ @param Str1 First string to perform case insensitive comparison.\r
@param Str2 Second string to perform case insensitive comparison.\r
\r
**/\r
Reads a block of data from the block device by calling\r
underlying Block I/O service.\r
\r
- @param PrivateData Global memory map for accessing global variables \r
- @param BlockDeviceNo The index for the block device number. \r
- @param Lba The logic block address to read data from. \r
- @param BufferSize The size of data in byte to read. \r
- @param Buffer The buffer of the \r
+ @param PrivateData Global memory map for accessing global variables\r
+ @param BlockDeviceNo The index for the block device number.\r
+ @param Lba The logic block address to read data from.\r
+ @param BufferSize The size of data in byte to read.\r
+ @param Buffer The buffer of the\r
\r
- @retval EFI_DEVICE_ERROR The specified block device number exceeds the maximum \r
- device number. \r
- @retval EFI_DEVICE_ERROR The maximum address has exceeded the maximum address \r
+ @retval EFI_DEVICE_ERROR The specified block device number exceeds the maximum\r
+ device number.\r
+ @retval EFI_DEVICE_ERROR The maximum address has exceeded the maximum address\r
of the block device.\r
\r
**/\r
volume structure. Note there should be a valid Block device number\r
already set.\r
\r
- @param PrivateData Global memory map for accessing global \r
- variables. \r
- @param Volume On input, the BlockDeviceNumber field of the \r
- Volume should be a valid value. On successful \r
- output, all fields except the VolumeNumber \r
- field is initialized. \r
+ @param PrivateData Global memory map for accessing global\r
+ variables.\r
+ @param Volume On input, the BlockDeviceNumber field of the\r
+ Volume should be a valid value. On successful\r
+ output, all fields except the VolumeNumber\r
+ field is initialized.\r
\r
- @retval EFI_SUCCESS A FAT is found and the volume structure is \r
- initialized. \r
- @retval EFI_NOT_FOUND There is no FAT on the corresponding device. \r
+ @retval EFI_SUCCESS A FAT is found and the volume structure is\r
+ initialized.\r
+ @retval EFI_NOT_FOUND There is no FAT on the corresponding device.\r
@retval EFI_DEVICE_ERROR There is something error while accessing device.\r
\r
**/\r
/**\r
Gets the next cluster in the cluster chain.\r
\r
- @param PrivateData Global memory map for accessing global variables \r
- @param Volume The volume \r
- @param Cluster The cluster \r
- @param NextCluster The cluster number of the next cluster \r
+ @param PrivateData Global memory map for accessing global variables\r
+ @param Volume The volume\r
+ @param Cluster The cluster\r
+ @param NextCluster The cluster number of the next cluster\r
\r
- @retval EFI_SUCCESS The address is got \r
- @retval EFI_INVALID_PARAMETER ClusterNo exceeds the MaxCluster of the volume. \r
+ @retval EFI_SUCCESS The address is got\r
+ @retval EFI_INVALID_PARAMETER ClusterNo exceeds the MaxCluster of the volume.\r
@retval EFI_DEVICE_ERROR Read disk error\r
\r
**/\r
/**\r
Disk reading.\r
\r
- @param PrivateData the global memory map; \r
- @param BlockDeviceNo the block device to read; \r
- @param StartingAddress the starting address. \r
- @param Size the amount of data to read. \r
- @param Buffer the buffer holding the data \r
+ @param PrivateData the global memory map;\r
+ @param BlockDeviceNo the block device to read;\r
+ @param StartingAddress the starting address.\r
+ @param Size the amount of data to read.\r
+ @param Buffer the buffer holding the data\r
\r
@retval EFI_SUCCESS The function completed successfully.\r
@retval EFI_DEVICE_ERROR Something error.\r
/**\r
Set a file's CurrentPos and CurrentCluster, then compute StraightReadAmount.\r
\r
- @param PrivateData the global memory map \r
- @param File the file \r
- @param Pos the Position which is offset from the file's \r
- CurrentPos \r
+ @param PrivateData the global memory map\r
+ @param File the file\r
+ @param Pos the Position which is offset from the file's\r
+ CurrentPos\r
\r
- @retval EFI_SUCCESS Success. \r
- @retval EFI_INVALID_PARAMETER Pos is beyond file's size. \r
+ @retval EFI_SUCCESS Success.\r
+ @retval EFI_INVALID_PARAMETER Pos is beyond file's size.\r
@retval EFI_DEVICE_ERROR Something error while accessing media.\r
\r
**/\r
/**\r
Reads file data. Updates the file's CurrentPos.\r
\r
- @param PrivateData Global memory map for accessing global variables \r
- @param File The file. \r
- @param Size The amount of data to read. \r
- @param Buffer The buffer storing the data. \r
+ @param PrivateData Global memory map for accessing global variables\r
+ @param File The file.\r
+ @param Size The amount of data to read.\r
+ @param Buffer The buffer storing the data.\r
\r
- @retval EFI_SUCCESS The data is read. \r
- @retval EFI_INVALID_PARAMETER File is invalid. \r
+ @retval EFI_SUCCESS The data is read.\r
+ @retval EFI_INVALID_PARAMETER File is invalid.\r
@retval EFI_DEVICE_ERROR Something error while accessing media.\r
\r
**/\r
The function updates the CurrentPos of the parent dir to after the item read.\r
If no more items were found, the function returns EFI_NOT_FOUND.\r
\r
- @param PrivateData Global memory map for accessing global variables \r
- @param ParentDir The parent directory. \r
- @param SubFile The File structure containing the sub file that \r
- is caught. \r
+ @param PrivateData Global memory map for accessing global variables\r
+ @param ParentDir The parent directory.\r
+ @param SubFile The File structure containing the sub file that\r
+ is caught.\r
\r
- @retval EFI_SUCCESS The next sub file is obtained. \r
- @retval EFI_INVALID_PARAMETER The ParentDir is not a directory. \r
- @retval EFI_NOT_FOUND No more sub file exists. \r
+ @retval EFI_SUCCESS The next sub file is obtained.\r
+ @retval EFI_INVALID_PARAMETER The ParentDir is not a directory.\r
+ @retval EFI_NOT_FOUND No more sub file exists.\r
@retval EFI_DEVICE_ERROR Something error while accessing media.\r
\r
**/\r