X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=EdkModulePkg%2FBus%2FPci%2FIdeBus%2FDxe%2Fidebus.c;h=c1c14052f1826621e14af9a88fb1d9c8f6fb0879;hb=c094abe5852057ef47941d8de3af20b2286cd822;hp=fd04b672161cbb6e60a2b48bc121c1587b8819a3;hpb=1cc8ee7861a59532700a6fd1255689576eda0f52;p=mirror_edk2.git diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c index fd04b67216..c1c14052f1 100644 --- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c +++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c @@ -1,5 +1,5 @@ /** @file - Copyright (c) 2006, Intel Corporation + Copyright (c) 2006 - 2007 Intel Corporation.
All rights reserved. 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 @@ -91,7 +91,7 @@ IDEBusDriverBindingSupported ( } // - // Clsoe protocol, don't use device path protocol in the .Support() function + // Close protocol, don't use device path protocol in the .Support() function // gBS->CloseProtocol ( Controller, @@ -629,7 +629,11 @@ IDEBusDriverBindingStart ( IdeBlkIoDevicePtr = NULL; continue; } - + // + // Record Udma Mode + // + IdeBlkIoDevicePtr->UdmaMode.Valid = TRUE; + IdeBlkIoDevicePtr->UdmaMode.Mode = SupportedModes->UdmaMode.Mode; EnableInterrupt (IdeBlkIoDevicePtr); } else if (SupportedModes->MultiWordDmaMode.Valid) { @@ -1031,6 +1035,9 @@ IDEBlkIoReset ( { IDE_BLK_IO_DEV *IdeBlkIoDevice; EFI_STATUS Status; + EFI_TPL OldTpl; + + OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK); IdeBlkIoDevice = IDE_BLOCK_IO_DEV_FROM_THIS (This); // @@ -1043,11 +1050,13 @@ IDEBlkIoReset ( // if (IdeBlkIoDevice->Type == IdeHardDisk || IdeBlkIoDevice->Type == Ide48bitAddressingHardDisk) { - return AtaSoftReset (IdeBlkIoDevice); + Status = AtaSoftReset (IdeBlkIoDevice); + goto Done; } if (IdeBlkIoDevice->Type == IdeUnknown) { - return EFI_DEVICE_ERROR; + Status = EFI_DEVICE_ERROR; + goto Done; } // @@ -1058,6 +1067,8 @@ IDEBlkIoReset ( Status = AtaSoftReset (IdeBlkIoDevice); } +Done: + gBS->RestoreTPL (OldTpl); return Status; } @@ -1085,6 +1096,10 @@ IDEBlkIoReadBlocks ( // TODO: EFI_DEVICE_ERROR - add return value to function comment { IDE_BLK_IO_DEV *IdeBlkIoDevice; + EFI_STATUS Status; + EFI_TPL OldTpl; + + OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK); IdeBlkIoDevice = IDE_BLOCK_IO_DEV_FROM_THIS (This); @@ -1098,23 +1113,25 @@ IDEBlkIoReadBlocks ( // if (IdeBlkIoDevice->Type == IdeHardDisk || IdeBlkIoDevice->Type == Ide48bitAddressingHardDisk) { - return AtaBlkIoReadBlocks ( + Status = AtaBlkIoReadBlocks ( IdeBlkIoDevice, MediaId, LBA, BufferSize, Buffer ); + goto Done; } if (IdeBlkIoDevice->Type == IdeUnknown) { - return EFI_DEVICE_ERROR; + Status = EFI_DEVICE_ERROR; + goto Done; } // // for ATAPI device, using ATAPI read block's mechanism // - return AtapiBlkIoReadBlocks ( + Status = AtapiBlkIoReadBlocks ( IdeBlkIoDevice, MediaId, LBA, @@ -1122,6 +1139,10 @@ IDEBlkIoReadBlocks ( Buffer ); +Done: + gBS->RestoreTPL (OldTpl); + + return Status; } /** @@ -1148,7 +1169,11 @@ IDEBlkIoWriteBlocks ( // TODO: EFI_DEVICE_ERROR - add return value to function comment { IDE_BLK_IO_DEV *IdeBlkIoDevice; + EFI_STATUS Status; + EFI_TPL OldTpl; + OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK); + IdeBlkIoDevice = IDE_BLOCK_IO_DEV_FROM_THIS (This); // // Requery IDE IO resources in case of the switch of native and legacy modes @@ -1161,29 +1186,35 @@ IDEBlkIoWriteBlocks ( if (IdeBlkIoDevice->Type == IdeHardDisk || IdeBlkIoDevice->Type == Ide48bitAddressingHardDisk) { - return AtaBlkIoWriteBlocks ( + Status = AtaBlkIoWriteBlocks ( IdeBlkIoDevice, MediaId, LBA, BufferSize, Buffer ); + goto Done; } if (IdeBlkIoDevice->Type == IdeUnknown) { - return EFI_DEVICE_ERROR; + Status = EFI_DEVICE_ERROR; + goto Done; } // // for ATAPI device, using ATAPI write block's mechanism // - return AtapiBlkIoWriteBlocks ( + Status = AtapiBlkIoWriteBlocks ( IdeBlkIoDevice, MediaId, LBA, BufferSize, Buffer ); + +Done: + gBS->RestoreTPL (OldTpl); + return Status; } //