mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/DiskIo: Introduced 'PcdDiskIoDataBufferBlockNum'
PcdDiskIoDataBufferBlockNum replaced the hardcoded value into the Disk I/O driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-By: Tian, Feng <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15235 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
336c8e116b
commit
e645bd857d
|
@ -882,6 +882,11 @@
|
|||
## This PCD specifies whether full PCI enumeration is disabled.
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE|BOOLEAN|0x10000048
|
||||
|
||||
## Disk I/O - Number of Data Buffer block
|
||||
# Define the size in block of the pre-allocated buffer. It provide better
|
||||
# performance for large Disk I/O requests
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdDiskIoDataBufferBlockNum|64|UINT32|0x30001039
|
||||
|
||||
[PcdsPatchableInModule]
|
||||
## Specify memory size with page number for PEI code when
|
||||
# the feature of Loading Module at Fixed Address is enabled
|
||||
|
|
|
@ -183,7 +183,7 @@ DiskIoDriverBindingStart (
|
|||
InitializeListHead (&Instance->TaskQueue);
|
||||
EfiInitializeLock (&Instance->TaskQueueLock, TPL_NOTIFY);
|
||||
Instance->SharedWorkingBuffer = AllocateAlignedPages (
|
||||
EFI_SIZE_TO_PAGES (DATA_BUFFER_BLOCK_NUM * Instance->BlockIo->Media->BlockSize),
|
||||
EFI_SIZE_TO_PAGES (PcdGet32 (PcdDiskIoDataBufferBlockNum) * Instance->BlockIo->Media->BlockSize),
|
||||
Instance->BlockIo->Media->IoAlign
|
||||
);
|
||||
if (Instance->SharedWorkingBuffer == NULL) {
|
||||
|
@ -214,7 +214,7 @@ ErrorExit:
|
|||
if (Instance != NULL && Instance->SharedWorkingBuffer != NULL) {
|
||||
FreeAlignedPages (
|
||||
Instance->SharedWorkingBuffer,
|
||||
EFI_SIZE_TO_PAGES (DATA_BUFFER_BLOCK_NUM * Instance->BlockIo->Media->BlockSize)
|
||||
EFI_SIZE_TO_PAGES (PcdGet32 (PcdDiskIoDataBufferBlockNum) * Instance->BlockIo->Media->BlockSize)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -324,7 +324,7 @@ DiskIoDriverBindingStop (
|
|||
|
||||
FreeAlignedPages (
|
||||
Instance->SharedWorkingBuffer,
|
||||
EFI_SIZE_TO_PAGES (DATA_BUFFER_BLOCK_NUM * Instance->BlockIo->Media->BlockSize)
|
||||
EFI_SIZE_TO_PAGES (PcdGet32 (PcdDiskIoDataBufferBlockNum) * Instance->BlockIo->Media->BlockSize)
|
||||
);
|
||||
|
||||
Status = gBS->CloseProtocol (
|
||||
|
@ -655,8 +655,8 @@ DiskIoCreateSubtaskList (
|
|||
// Use the allocated buffer instead of the original buffer
|
||||
// to avoid alignment issue.
|
||||
//
|
||||
for (; Lba < OverRunLba; Lba += DATA_BUFFER_BLOCK_NUM) {
|
||||
DataBufferSize = MIN (BufferSize, DATA_BUFFER_BLOCK_NUM * BlockSize);
|
||||
for (; Lba < OverRunLba; Lba += PcdGet32 (PcdDiskIoDataBufferBlockNum)) {
|
||||
DataBufferSize = MIN (BufferSize, PcdGet32 (PcdDiskIoDataBufferBlockNum) * BlockSize);
|
||||
|
||||
Subtask = DiskIoCreateSubtask (Write, Lba, 0, DataBufferSize, SharedWorkingBuffer, BufferPtr, Blocking);
|
||||
if (Subtask == NULL) {
|
||||
|
|
|
@ -30,13 +30,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
|
||||
//
|
||||
// Pre-allocate an aligned buffer of 64 blocks so very large Disk I/O requests
|
||||
// will be broken up into 64 * BlockSize chunks to provide better performance
|
||||
// than allocating an aligned 1 block buffer.
|
||||
//
|
||||
#define DATA_BUFFER_BLOCK_NUM 64
|
||||
|
||||
#define DISK_IO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('d', 's', 'k', 'I')
|
||||
typedef struct {
|
||||
UINT32 Signature;
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
UefiBootServicesTableLib
|
||||
|
@ -55,7 +55,7 @@
|
|||
UefiLib
|
||||
UefiDriverEntryPoint
|
||||
DebugLib
|
||||
|
||||
PcdLib
|
||||
|
||||
[Protocols]
|
||||
gEfiDiskIoProtocolGuid ## BY_START
|
||||
|
@ -63,3 +63,5 @@
|
|||
gEfiBlockIoProtocolGuid ## TO_START
|
||||
gEfiBlockIo2ProtocolGuid ## TO_START
|
||||
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdDiskIoDataBufferBlockNum
|
||||
|
|
Loading…
Reference in New Issue