From bad880b1722b154f3c332f8e3e785e42f9b6af96 Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Thu, 31 Mar 2011 12:16:28 +0000 Subject: [PATCH] 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 --- ArmPkg/Library/BdsLib/BdsAppLoader.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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; -- 2.39.2