mirror of https://github.com/acidanthera/audk.git
ArmPkg/BdsLib: Prevent application to hang the platform using watchdog
Before to start an image we start the watchdog. And it stops when the application returns. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11478 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
20fd35dc44
commit
bad880b172
|
@ -34,7 +34,16 @@ BdsLoadPeCoff (
|
||||||
|
|
||||||
Status = gBS->LoadImage (TRUE, gImageHandle, DevicePath, NULL, 0, &ImageHandle);
|
Status = gBS->LoadImage (TRUE, gImageHandle, DevicePath, NULL, 0, &ImageHandle);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// Before calling the image, enable the Watchdog Timer for
|
||||||
|
// the 5 Minute period
|
||||||
|
//
|
||||||
|
gBS->SetWatchdogTimer (5 * 60, 0x0000, 0x00, NULL);
|
||||||
Status = gBS->StartImage (ImageHandle, NULL, NULL);
|
Status = gBS->StartImage (ImageHandle, NULL, NULL);
|
||||||
|
//
|
||||||
|
// Clear the Watchdog Timer after the image returns
|
||||||
|
//
|
||||||
|
gBS->SetWatchdogTimer (0x0000, 0x0000, 0x0000, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
Loading…
Reference in New Issue