]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/DefaultExceptionHandlerLib ARM: avoid endless loop in RELEASE builds
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 11 Dec 2018 13:23:28 +0000 (14:23 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 19 Dec 2018 20:03:08 +0000 (21:03 +0100)
Ensure that we prevent the CPU from proceeding after having taken an
unhandled exception on a RELEASE build, which does not contain the
ASSERT() which ensures this on DEBUG and NOOPT builds.

Retain the code following the deadloop so that we can keep going when
running in a debugger.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c

index 0b9da031b47d85ed7cad5474d7c16a3eb8451832..cc79cb2fa3017bdd33fe7de616099f18a84aeb16 100644 (file)
@@ -267,6 +267,8 @@ DefaultExceptionHandler (
   DEBUG ((EFI_D_ERROR, "\n"));\r
   ASSERT (FALSE);\r
 \r
   DEBUG ((EFI_D_ERROR, "\n"));\r
   ASSERT (FALSE);\r
 \r
+  CpuDeadLoop ();   // may return if executing under a debugger\r
+\r
   // Clear the error registers that we have already displayed incase some one wants to keep going\r
   SystemContext.SystemContextArm->DFSR = 0;\r
   SystemContext.SystemContextArm->IFSR = 0;\r
   // Clear the error registers that we have already displayed incase some one wants to keep going\r
   SystemContext.SystemContextArm->DFSR = 0;\r
   SystemContext.SystemContextArm->IFSR = 0;\r