/** @file\r
- DiskIo driver that layers it's self on every Block IO protocol in the system.\r
+ DiskIo driver that lays on every BlockIo protocol in the system.\r
DiskIo converts a block oriented device to a byte oriented device.\r
\r
- ReadDisk may have to do reads that are not aligned on sector boundaries.\r
+ Disk access may have to handle unaligned request about sector boundaries.\r
There are three cases:\r
UnderRun - The first byte is not on a sector boundary or the read request is\r
less than a sector in length.\r
Aligned - A read of N contiguous sectors.\r
OverRun - The last byte is not on a sector boundary.\r
\r
- Copyright (c) 2006 - 2007, Intel Corporation \r
- All rights reserved. This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
+Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
#include "DiskIo.h"\r
\r
+//\r
+// Driver binding protocol implementation for DiskIo driver.\r
+//\r
EFI_DRIVER_BINDING_PROTOCOL gDiskIoDriverBinding = {\r
DiskIoDriverBindingSupported,\r
DiskIoDriverBindingStart,\r
NULL\r
};\r
\r
+//\r
+// Template for DiskIo private data structure.\r
+// The pointer to BlockIo protocol interface is assigned dynamically.\r
+//\r
DISK_IO_PRIVATE_DATA gDiskIoPrivateDataTemplate = {\r
DISK_IO_PRIVATE_DATA_SIGNATURE,\r
{\r
{\r
EFI_STATUS Status;\r
DISK_IO_PRIVATE_DATA *Private;\r
+ EFI_TPL OldTpl;\r
\r
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
Private = NULL;\r
\r
//\r
EFI_OPEN_PROTOCOL_BY_DRIVER\r
);\r
if (EFI_ERROR (Status)) {\r
- return Status;\r
+ goto ErrorExit1;\r
}\r
\r
//\r
);\r
}\r
\r
+ErrorExit1:\r
+ gBS->RestoreTPL (OldTpl);\r
return Status;\r
}\r
\r
&Private->DiskIo\r
);\r
if (!EFI_ERROR (Status)) {\r
-\r
Status = gBS->CloseProtocol (\r
ControllerHandle,\r
&gEfiBlockIoProtocolGuid,\r
\r
\r
/**\r
- Read BufferSize bytes from Offset into Buffer.\r
+ Writes BufferSize bytes from Buffer into Offset.\r
Writes may require a read modify write to support writes that are not\r
aligned on sector boundaries. There are three cases:\r
UnderRun - The first byte is not on a sector boundary or the write request\r