]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c
ArmPkg: Fix various typos
[mirror_edk2.git] / ArmPkg / Library / DefaultExceptionHandlerLib / AArch64 / DefaultExceptionHandler.c
index 1024bf48c63d2fac3398f87bde09647b2f3727c9..ba3c0e0cc467096f52828ec1a5c39f7654554053 100644 (file)
@@ -4,13 +4,7 @@
   Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
   Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>\r
 \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -22,6 +16,7 @@
 #include <Library/PrintLib.h>\r
 #include <Library/ArmDisassemblerLib.h>\r
 #include <Library/SerialPortLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
 \r
 #include <Guid/DebugImageInfoTable.h>\r
 #include <Protocol/DebugSupport.h>\r
@@ -142,7 +137,7 @@ BaseName (
 /**\r
   This is the default action to take on an unexpected exception\r
 \r
-  Since this is exception context don't do anything crazy like try to allcoate memory.\r
+  Since this is exception context don't do anything crazy like try to allocate memory.\r
 \r
   @param  ExceptionType    Type of the exception\r
   @param  SystemContext    Register state at the time of the Exception\r
@@ -159,14 +154,21 @@ DefaultExceptionHandler (
   INT32  Offset;\r
 \r
   if (mRecursiveException) {\r
-    CharCount = AsciiSPrint (Buffer, sizeof (Buffer),"\nRecursive exception occurred while dumping the CPU state\n");\r
-    SerialPortWrite ((UINT8 *) Buffer, CharCount);\r
+    STATIC CHAR8 CONST Message[] = "\nRecursive exception occurred while dumping the CPU state\n";\r
+\r
+    SerialPortWrite ((UINT8 *)Message, sizeof Message - 1);\r
+    if (gST->ConOut != NULL) {\r
+      AsciiPrint (Message);\r
+    }\r
     CpuDeadLoop ();\r
   }\r
   mRecursiveException = TRUE;\r
 \r
   CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"\n\n%a Exception at 0x%016lx\n", gExceptionTypeString[ExceptionType], SystemContext.SystemContextAArch64->ELR);\r
   SerialPortWrite ((UINT8 *) Buffer, CharCount);\r
+  if (gST->ConOut != NULL) {\r
+    AsciiPrint (Buffer);\r
+  }\r
 \r
   DEBUG_CODE_BEGIN ();\r
     CHAR8  *Pdb, *PrevPdb;\r