summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library/DefaultExceptionHandlerLib/Arm
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-12-20 18:31:04 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2019-01-16 21:33:35 +0100
commit31f5388006fcb6e8582e5bce3f5438ae707de986 (patch)
treed05e5de65bfcee84830a943cdde3137142057015 /ArmPkg/Library/DefaultExceptionHandlerLib/Arm
parent1e32c49718c69e749f4b401cbb6c198a1d9bac50 (diff)
downloadedk2-31f5388006fcb6e8582e5bce3f5438ae707de986.tar.gz
edk2-31f5388006fcb6e8582e5bce3f5438ae707de986.tar.bz2
edk2-31f5388006fcb6e8582e5bce3f5438ae707de986.zip
ArmPkg/DefaultExceptionHandlerLib: use console if available
Print the minimal 'exception occurred' message to the console as well as to the serial port if the console is available. This makes such messages visible on systems where the console is graphical and the serial is not connected. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'ArmPkg/Library/DefaultExceptionHandlerLib/Arm')
-rw-r--r--ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c b/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c
index cc79cb2fa3..2e0cfb2d4e 100644
--- a/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c
+++ b/ArmPkg/Library/DefaultExceptionHandlerLib/Arm/DefaultExceptionHandler.c
@@ -21,6 +21,7 @@
#include <Library/PrintLib.h>
#include <Library/ArmDisassemblerLib.h>
#include <Library/SerialPortLib.h>
+#include <Library/UefiBootServicesTableLib.h>
#include <Guid/DebugImageInfoTable.h>
@@ -194,7 +195,10 @@ DefaultExceptionHandler (
CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"\n%a Exception PC at 0x%08x CPSR 0x%08x ",
gExceptionTypeString[ExceptionType], SystemContext.SystemContextArm->PC, SystemContext.SystemContextArm->CPSR);
- SerialPortWrite ((UINT8 *) Buffer, CharCount);
+ SerialPortWrite ((UINT8 *)Buffer, CharCount);
+ if (gST->ConOut != NULL) {
+ AsciiPrint (Buffer);
+ }
DEBUG_CODE_BEGIN ();
CHAR8 *Pdb;