fixed DMA not be stopped issue when gBS->ExitBootServices called.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8058 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2009-04-10 08:31:45 +00:00
parent f05b1c14ec
commit 0428a6cb12
10 changed files with 181 additions and 10 deletions

View File

@@ -1449,6 +1449,33 @@ EhcCreateUsb2Hc (
return Ehc;
}
/**
One notified function to stop the Host Controller when gBS->ExitBootServices() called.
@param Event Pointer to this event
@param Context Event hanlder private data
**/
VOID
EFIAPI
EhcExitBootService (
EFI_EVENT Event,
VOID *Context
)
{
USB2_HC_DEV *Ehc;
Ehc = (USB2_HC_DEV *) Context;
//
// Stop the Host Controller
//
EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT);
return;
}
/**
Starting the Usb EHCI Driver.
@@ -1584,6 +1611,21 @@ EhcDriverBindingStart (
goto UNINSTALL_USBHC;
}
//
// Create event to stop the HC when exit boot service.
//
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_NOTIFY,
EhcExitBootService,
Ehc,
&gEfiEventExitBootServicesGuid,
&Ehc->ExitBootServiceEvent
);
if (EFI_ERROR (Status)) {
goto UNINSTALL_USBHC;
}
//
// Install the component name protocol, don't fail the start
// because of something for display.
@@ -1712,6 +1754,10 @@ EhcDriverBindingStop (
gBS->CloseEvent (Ehc->PollTimer);
}
if (Ehc->ExitBootServiceEvent != NULL) {
gBS->CloseEvent (Ehc->ExitBootServiceEvent);
}
EhcFreeSched (Ehc);
if (Ehc->ControllerNameTable != NULL) {