## This PCD specifies whether full PCI enumeration is disabled.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE|BOOLEAN|0x10000048\r
\r
+ ## Disk I/O - Number of Data Buffer block\r
+ # Define the size in block of the pre-allocated buffer. It provide better\r
+ # performance for large Disk I/O requests\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdDiskIoDataBufferBlockNum|64|UINT32|0x30001039\r
+\r
[PcdsPatchableInModule]\r
## Specify memory size with page number for PEI code when \r
# the feature of Loading Module at Fixed Address is enabled\r
InitializeListHead (&Instance->TaskQueue);\r
EfiInitializeLock (&Instance->TaskQueueLock, TPL_NOTIFY);\r
Instance->SharedWorkingBuffer = AllocateAlignedPages (\r
- EFI_SIZE_TO_PAGES (DATA_BUFFER_BLOCK_NUM * Instance->BlockIo->Media->BlockSize),\r
+ EFI_SIZE_TO_PAGES (PcdGet32 (PcdDiskIoDataBufferBlockNum) * Instance->BlockIo->Media->BlockSize),\r
Instance->BlockIo->Media->IoAlign\r
);\r
if (Instance->SharedWorkingBuffer == NULL) {\r
if (Instance != NULL && Instance->SharedWorkingBuffer != NULL) {\r
FreeAlignedPages (\r
Instance->SharedWorkingBuffer,\r
- EFI_SIZE_TO_PAGES (DATA_BUFFER_BLOCK_NUM * Instance->BlockIo->Media->BlockSize)\r
+ EFI_SIZE_TO_PAGES (PcdGet32 (PcdDiskIoDataBufferBlockNum) * Instance->BlockIo->Media->BlockSize)\r
);\r
}\r
\r
\r
FreeAlignedPages (\r
Instance->SharedWorkingBuffer,\r
- EFI_SIZE_TO_PAGES (DATA_BUFFER_BLOCK_NUM * Instance->BlockIo->Media->BlockSize)\r
+ EFI_SIZE_TO_PAGES (PcdGet32 (PcdDiskIoDataBufferBlockNum) * Instance->BlockIo->Media->BlockSize)\r
);\r
\r
Status = gBS->CloseProtocol (\r
// Use the allocated buffer instead of the original buffer\r
// to avoid alignment issue.\r
//\r
- for (; Lba < OverRunLba; Lba += DATA_BUFFER_BLOCK_NUM) {\r
- DataBufferSize = MIN (BufferSize, DATA_BUFFER_BLOCK_NUM * BlockSize);\r
+ for (; Lba < OverRunLba; Lba += PcdGet32 (PcdDiskIoDataBufferBlockNum)) {\r
+ DataBufferSize = MIN (BufferSize, PcdGet32 (PcdDiskIoDataBufferBlockNum) * BlockSize);\r
\r
Subtask = DiskIoCreateSubtask (Write, Lba, 0, DataBufferSize, SharedWorkingBuffer, BufferPtr, Blocking);\r
if (Subtask == NULL) {\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
\r
-//\r
-// Pre-allocate an aligned buffer of 64 blocks so very large Disk I/O requests\r
-// will be broken up into 64 * BlockSize chunks to provide better performance\r
-// than allocating an aligned 1 block buffer.\r
-//\r
-#define DATA_BUFFER_BLOCK_NUM 64\r
-\r
#define DISK_IO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('d', 's', 'k', 'I')\r
typedef struct {\r
UINT32 Signature;\r
\r
[Packages]\r
MdePkg/MdePkg.dec\r
-\r
+ MdeModulePkg/MdeModulePkg.dec\r
\r
[LibraryClasses]\r
UefiBootServicesTableLib\r
UefiLib\r
UefiDriverEntryPoint\r
DebugLib\r
-\r
+ PcdLib\r
\r
[Protocols]\r
gEfiDiskIoProtocolGuid ## BY_START\r
gEfiBlockIoProtocolGuid ## TO_START\r
gEfiBlockIo2ProtocolGuid ## TO_START\r
\r
+[Pcd]\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdDiskIoDataBufferBlockNum\r