mirror of https://github.com/acidanthera/audk.git
when timeout is 0, infinite loop on the timeout request to follow UEFI spec
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11343 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
6617d838fa
commit
17a6c337d2
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
EHCI transfer scheduling routines.
|
EHCI transfer scheduling routines.
|
||||||
|
|
||||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -691,12 +691,23 @@ EhcExecTransfer (
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINTN Loop;
|
UINTN Loop;
|
||||||
BOOLEAN Finished;
|
BOOLEAN Finished;
|
||||||
|
BOOLEAN InfiniteLoop;
|
||||||
|
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
Loop = (TimeOut * EHC_1_MILLISECOND / EHC_SYNC_POLL_INTERVAL) + 1;
|
Loop = (TimeOut * EHC_1_MILLISECOND / EHC_SYNC_POLL_INTERVAL) + 1;
|
||||||
Finished = FALSE;
|
Finished = FALSE;
|
||||||
|
InfiniteLoop = FALSE;
|
||||||
|
|
||||||
for (Index = 0; Index < Loop; Index++) {
|
//
|
||||||
|
// According to UEFI spec section 16.2.4, If Timeout is 0, then the caller
|
||||||
|
// must wait for the function to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR
|
||||||
|
// is returned.
|
||||||
|
//
|
||||||
|
if (TimeOut == 0) {
|
||||||
|
InfiniteLoop = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Index = 0; InfiniteLoop || (Index < Loop); Index++) {
|
||||||
Finished = EhcCheckUrbResult (Ehc, Urb);
|
Finished = EhcCheckUrbResult (Ehc, Urb);
|
||||||
|
|
||||||
if (Finished) {
|
if (Finished) {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
The EHCI register operation routines.
|
The EHCI register operation routines.
|
||||||
|
|
||||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -576,12 +576,23 @@ UhciExecuteTransfer (
|
||||||
UINTN Delay;
|
UINTN Delay;
|
||||||
BOOLEAN Finished;
|
BOOLEAN Finished;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
BOOLEAN InfiniteLoop;
|
||||||
|
|
||||||
Finished = FALSE;
|
Finished = FALSE;
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
Delay = (TimeOut * UHC_1_MILLISECOND / UHC_SYNC_POLL_INTERVAL) + 1;
|
Delay = (TimeOut * UHC_1_MILLISECOND / UHC_SYNC_POLL_INTERVAL) + 1;
|
||||||
|
InfiniteLoop = FALSE;
|
||||||
|
|
||||||
for (Index = 0; Index < Delay; Index++) {
|
//
|
||||||
|
// According to UEFI spec section 16.2.4, If Timeout is 0, then the caller
|
||||||
|
// must wait for the function to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR
|
||||||
|
// is returned.
|
||||||
|
//
|
||||||
|
if (TimeOut == 0) {
|
||||||
|
InfiniteLoop = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Index = 0; InfiniteLoop || (Index < Delay); Index++) {
|
||||||
Finished = UhciCheckTdStatus (Uhc, Td, IsLow, QhResult);
|
Finished = UhciCheckTdStatus (Uhc, Td, IsLow, QhResult);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue