]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/BdsLib: Prevent application to hang the platform using watchdog
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 31 Mar 2011 12:16:28 +0000 (12:16 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 31 Mar 2011 12:16:28 +0000 (12:16 +0000)
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

ArmPkg/Library/BdsLib/BdsAppLoader.c

index 1cc4fddbeacb87740e21694c33fc62f6bf57a58f..16b45ceb4cb2bcfd4f0f8fd7858d3152f12a37e3 100644 (file)
@@ -34,7 +34,16 @@ BdsLoadPeCoff (
 \r
     Status = gBS->LoadImage (TRUE, gImageHandle, DevicePath, NULL, 0, &ImageHandle);\r
     if (!EFI_ERROR (Status)) {\r
+        //\r
+        // Before calling the image, enable the Watchdog Timer for\r
+        // the 5 Minute period\r
+        //\r
+        gBS->SetWatchdogTimer (5 * 60, 0x0000, 0x00, NULL);\r
         Status = gBS->StartImage (ImageHandle, NULL, NULL);\r
+        //\r
+        // Clear the Watchdog Timer after the image returns\r
+        //\r
+        gBS->SetWatchdogTimer (0x0000, 0x0000, 0x0000, NULL);\r
     }\r
   \r
     return Status;\r