Change Fat driver to support asynchronous File IO introduced in UEFI spec 2.3.1.D.
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> (based on FatPkg commit 063f6e8a9c263bafd52e1226399fc64d6d721dca) [jordan.l.justen@intel.com: Use script to relicense to 2-clause BSD] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Mark Doran <mark.doran@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
@@ -109,7 +109,8 @@ FatExchangeCachePage (
|
||||
IN FAT_VOLUME *Volume,
|
||||
IN CACHE_DATA_TYPE DataType,
|
||||
IN IO_MODE IoMode,
|
||||
IN CACHE_TAG *CacheTag
|
||||
IN CACHE_TAG *CacheTag,
|
||||
IN FAT_TASK *Task
|
||||
)
|
||||
/*++
|
||||
|
||||
@@ -167,7 +168,7 @@ Returns:
|
||||
//
|
||||
// Only fat table writing will execute more than once
|
||||
//
|
||||
Status = FatDiskIo (Volume, IoMode, EntryPos, RealSize, PageAddress);
|
||||
Status = FatDiskIo (Volume, IoMode, EntryPos, RealSize, PageAddress, Task);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
@@ -223,7 +224,7 @@ Returns:
|
||||
// Write dirty cache page back to disk
|
||||
//
|
||||
if (CacheTag->RealSize > 0 && CacheTag->Dirty) {
|
||||
Status = FatExchangeCachePage (Volume, CacheDataType, WRITE_DISK, CacheTag);
|
||||
Status = FatExchangeCachePage (Volume, CacheDataType, WRITE_DISK, CacheTag, NULL);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
@@ -232,7 +233,7 @@ Returns:
|
||||
// Load new data from disk;
|
||||
//
|
||||
CacheTag->PageNo = PageNo;
|
||||
Status = FatExchangeCachePage (Volume, CacheDataType, READ_DISK, CacheTag);
|
||||
Status = FatExchangeCachePage (Volume, CacheDataType, READ_DISK, CacheTag, NULL);
|
||||
|
||||
return Status;
|
||||
}
|
||||
@@ -305,7 +306,8 @@ FatAccessCache (
|
||||
IN IO_MODE IoMode,
|
||||
IN UINT64 Offset,
|
||||
IN UINTN BufferSize,
|
||||
IN OUT UINT8 *Buffer
|
||||
IN OUT UINT8 *Buffer,
|
||||
IN FAT_TASK *Task
|
||||
)
|
||||
/*++
|
||||
Routine Description:
|
||||
@@ -393,7 +395,7 @@ Returns:
|
||||
|
||||
EntryPos = Volume->RootPos + LShiftU64 (PageNo, PageAlignment);
|
||||
AlignedSize = AlignedPageCount << PageAlignment;
|
||||
Status = FatDiskIo (Volume, IoMode, EntryPos, AlignedSize, Buffer);
|
||||
Status = FatDiskIo (Volume, IoMode, EntryPos, AlignedSize, Buffer, Task);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
@@ -421,7 +423,8 @@ Returns:
|
||||
|
||||
EFI_STATUS
|
||||
FatVolumeFlushCache (
|
||||
IN FAT_VOLUME *Volume
|
||||
IN FAT_VOLUME *Volume,
|
||||
IN FAT_TASK *Task
|
||||
)
|
||||
/*++
|
||||
|
||||
@@ -460,7 +463,7 @@ Returns:
|
||||
//
|
||||
// Write back all Dirty Data Cache Page to disk
|
||||
//
|
||||
Status = FatExchangeCachePage (Volume, CacheDataType, WRITE_DISK, CacheTag);
|
||||
Status = FatExchangeCachePage (Volume, CacheDataType, WRITE_DISK, CacheTag, Task);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
Reference in New Issue
Block a user