summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-31 12:16:28 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-31 12:16:28 +0000
commitbad880b1722b154f3c332f8e3e785e42f9b6af96 (patch)
treec5c9c13c13577db7ee56b19316cc992286e4328a
parent20fd35dc44dce47c319c3917fc78c30160354cee (diff)
downloadedk2-platforms-bad880b1722b154f3c332f8e3e785e42f9b6af96.tar.xz
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
-rw-r--r--ArmPkg/Library/BdsLib/BdsAppLoader.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ArmPkg/Library/BdsLib/BdsAppLoader.c b/ArmPkg/Library/BdsLib/BdsAppLoader.c
index 1cc4fddbea..16b45ceb4c 100644
--- a/ArmPkg/Library/BdsLib/BdsAppLoader.c
+++ b/ArmPkg/Library/BdsLib/BdsAppLoader.c
@@ -34,7 +34,16 @@ BdsLoadPeCoff (
Status = gBS->LoadImage (TRUE, gImageHandle, DevicePath, NULL, 0, &ImageHandle);
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);
+ //
+ // Clear the Watchdog Timer after the image returns
+ //
+ gBS->SetWatchdogTimer (0x0000, 0x0000, 0x0000, NULL);
}
return Status;