125402f5d0660acde3ee382a36b065945251990dcHarry Liebel/** @file
225402f5d0660acde3ee382a36b065945251990dcHarry Liebel  Default exception handler
325402f5d0660acde3ee382a36b065945251990dcHarry Liebel
425402f5d0660acde3ee382a36b065945251990dcHarry Liebel  Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
5451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
625402f5d0660acde3ee382a36b065945251990dcHarry Liebel
725402f5d0660acde3ee382a36b065945251990dcHarry Liebel  This program and the accompanying materials
825402f5d0660acde3ee382a36b065945251990dcHarry Liebel  are licensed and made available under the terms and conditions of the BSD License
925402f5d0660acde3ee382a36b065945251990dcHarry Liebel  which accompanies this distribution.  The full text of the license may be found at
1025402f5d0660acde3ee382a36b065945251990dcHarry Liebel  http://opensource.org/licenses/bsd-license.php
1125402f5d0660acde3ee382a36b065945251990dcHarry Liebel
1225402f5d0660acde3ee382a36b065945251990dcHarry Liebel  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
1325402f5d0660acde3ee382a36b065945251990dcHarry Liebel  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
1425402f5d0660acde3ee382a36b065945251990dcHarry Liebel
1525402f5d0660acde3ee382a36b065945251990dcHarry Liebel**/
1625402f5d0660acde3ee382a36b065945251990dcHarry Liebel
1725402f5d0660acde3ee382a36b065945251990dcHarry Liebel#include <Uefi.h>
1825402f5d0660acde3ee382a36b065945251990dcHarry Liebel#include <Library/UefiLib.h>
1925402f5d0660acde3ee382a36b065945251990dcHarry Liebel#include <Library/BaseLib.h>
2025402f5d0660acde3ee382a36b065945251990dcHarry Liebel#include <Library/DebugLib.h>
2125402f5d0660acde3ee382a36b065945251990dcHarry Liebel#include <Library/PeCoffGetEntryPointLib.h>
2225402f5d0660acde3ee382a36b065945251990dcHarry Liebel#include <Library/PrintLib.h>
2325402f5d0660acde3ee382a36b065945251990dcHarry Liebel#include <Library/ArmDisassemblerLib.h>
2425402f5d0660acde3ee382a36b065945251990dcHarry Liebel#include <Library/SerialPortLib.h>
2525402f5d0660acde3ee382a36b065945251990dcHarry Liebel
2625402f5d0660acde3ee382a36b065945251990dcHarry Liebel#include <Guid/DebugImageInfoTable.h>
2725402f5d0660acde3ee382a36b065945251990dcHarry Liebel#include <Protocol/DebugSupport.h>
2825402f5d0660acde3ee382a36b065945251990dcHarry Liebel#include <Protocol/LoadedImage.h>
2925402f5d0660acde3ee382a36b065945251990dcHarry Liebel
3025402f5d0660acde3ee382a36b065945251990dcHarry LiebelEFI_DEBUG_IMAGE_INFO_TABLE_HEADER *gDebugImageTableHeader = NULL;
3125402f5d0660acde3ee382a36b065945251990dcHarry Liebel
3225402f5d0660acde3ee382a36b065945251990dcHarry LiebelSTATIC CHAR8 *gExceptionTypeString[] = {
3325402f5d0660acde3ee382a36b065945251990dcHarry Liebel  "Synchronous",
3425402f5d0660acde3ee382a36b065945251990dcHarry Liebel  "IRQ",
3525402f5d0660acde3ee382a36b065945251990dcHarry Liebel  "FIQ",
3625402f5d0660acde3ee382a36b065945251990dcHarry Liebel  "SError"
3725402f5d0660acde3ee382a36b065945251990dcHarry Liebel};
3825402f5d0660acde3ee382a36b065945251990dcHarry Liebel
3925402f5d0660acde3ee382a36b065945251990dcHarry LiebelCHAR8 *
4025402f5d0660acde3ee382a36b065945251990dcHarry LiebelGetImageName (
4125402f5d0660acde3ee382a36b065945251990dcHarry Liebel  IN  UINTN  FaultAddress,
4225402f5d0660acde3ee382a36b065945251990dcHarry Liebel  OUT UINTN  *ImageBase,
4325402f5d0660acde3ee382a36b065945251990dcHarry Liebel  OUT UINTN  *PeCoffSizeOfHeaders
4425402f5d0660acde3ee382a36b065945251990dcHarry Liebel  );
4525402f5d0660acde3ee382a36b065945251990dcHarry Liebel
46451b665890f69244f213d7aba4450394a21bc60cOlivier MartinSTATIC
47451b665890f69244f213d7aba4450394a21bc60cOlivier MartinVOID
48451b665890f69244f213d7aba4450394a21bc60cOlivier MartinDescribeInstructionOrDataAbort (
49451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  IN CHAR8 *AbortType,
50451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  IN UINTN Iss
51451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  )
52451b665890f69244f213d7aba4450394a21bc60cOlivier Martin{
53451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  CHAR8 *AbortCause;
54451b665890f69244f213d7aba4450394a21bc60cOlivier Martin
55451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  switch (Iss & 0x3f) {
56451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x0: AbortCause = "Address size fault, zeroth level of translation or translation table base register";  break;
57451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x1: AbortCause = "Address size fault, first level";  break;
58451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x2: AbortCause = "Address size fault, second level";  break;
59451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x3: AbortCause = "Address size fault, third level";  break;
60451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x4: AbortCause = "Translation fault, zeroth level";  break;
61451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x5: AbortCause = "Translation fault, first level";  break;
62451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x6: AbortCause = "Translation fault, second level";  break;
63451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x7: AbortCause = "Translation fault, third level";  break;
64451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x9: AbortCause = "Access flag fault, first level";  break;
65451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0xa: AbortCause = "Access flag fault, second level";  break;
66451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0xb: AbortCause = "Access flag fault, third level";  break;
67451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0xd: AbortCause = "Permission fault, first level";  break;
68451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0xe: AbortCause = "Permission fault, second level";  break;
69451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0xf: AbortCause = "Permission fault, third level";  break;
70451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x10: AbortCause = "Synchronous external abort";  break;
71451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x18: AbortCause = "Synchronous parity error on memory access";  break;
72451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x11: AbortCause = "Asynchronous external abort";  break;
73451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x19: AbortCause = "Asynchronous parity error on memory access";  break;
74451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x14: AbortCause = "Synchronous external abort on translation table walk, zeroth level";  break;
75451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x15: AbortCause = "Synchronous external abort on translation table walk, first level";  break;
76451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x16: AbortCause = "Synchronous external abort on translation table walk, second level";  break;
77451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x17: AbortCause = "Synchronous external abort on translation table walk, third level";  break;
78451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x1c: AbortCause = "Synchronous parity error on memory access on translation table walk, zeroth level";  break;
79451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x1d: AbortCause = "Synchronous parity error on memory access on translation table walk, first level";  break;
80451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x1e: AbortCause = "Synchronous parity error on memory access on translation table walk, second level";  break;
81451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x1f: AbortCause = "Synchronous parity error on memory access on translation table walk, third level";  break;
82451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x21: AbortCause = "Alignment fault";  break;
83451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x22: AbortCause = "Debug event";  break;
84451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x30: AbortCause = "TLB conflict abort";  break;
85451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x33:
86451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x34: AbortCause = "IMPLEMENTATION DEFINED";  break;
87451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x35:
88451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x36: AbortCause = "Domain fault"; break;
89451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    default: AbortCause = ""; break;
90451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  }
91451b665890f69244f213d7aba4450394a21bc60cOlivier Martin
92451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  DEBUG ((EFI_D_ERROR, "\n%a: %a\n", AbortType, AbortCause));
93451b665890f69244f213d7aba4450394a21bc60cOlivier Martin}
94451b665890f69244f213d7aba4450394a21bc60cOlivier Martin
95451b665890f69244f213d7aba4450394a21bc60cOlivier MartinSTATIC
96451b665890f69244f213d7aba4450394a21bc60cOlivier MartinVOID
97451b665890f69244f213d7aba4450394a21bc60cOlivier MartinDescribeExceptionSyndrome (
98451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  IN UINT32 Esr
99451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  )
100451b665890f69244f213d7aba4450394a21bc60cOlivier Martin{
101451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  CHAR8 *Message;
102451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  UINTN Ec;
103451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  UINTN Iss;
104451b665890f69244f213d7aba4450394a21bc60cOlivier Martin
105451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  Ec = Esr >> 26;
106451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  Iss = Esr & 0x00ffffff;
107451b665890f69244f213d7aba4450394a21bc60cOlivier Martin
108451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  switch (Ec) {
109451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x15: Message = "SVC executed in AArch64"; break;
110451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x20:
111451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x21: DescribeInstructionOrDataAbort ("Instruction abort", Iss); return;
112451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x22: Message = "PC alignment fault"; break;
113451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x23: Message = "SP alignment fault"; break;
114451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x24:
115451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    case 0x25: DescribeInstructionOrDataAbort ("Data abort", Iss); return;
116451b665890f69244f213d7aba4450394a21bc60cOlivier Martin    default: return;
117451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  }
118451b665890f69244f213d7aba4450394a21bc60cOlivier Martin
119451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  DEBUG ((EFI_D_ERROR, "\n %a \n", Message));
120451b665890f69244f213d7aba4450394a21bc60cOlivier Martin}
121451b665890f69244f213d7aba4450394a21bc60cOlivier Martin
12225402f5d0660acde3ee382a36b065945251990dcHarry Liebel/**
12325402f5d0660acde3ee382a36b065945251990dcHarry Liebel  This is the default action to take on an unexpected exception
12425402f5d0660acde3ee382a36b065945251990dcHarry Liebel
12525402f5d0660acde3ee382a36b065945251990dcHarry Liebel  Since this is exception context don't do anything crazy like try to allcoate memory.
12625402f5d0660acde3ee382a36b065945251990dcHarry Liebel
12725402f5d0660acde3ee382a36b065945251990dcHarry Liebel  @param  ExceptionType    Type of the exception
12825402f5d0660acde3ee382a36b065945251990dcHarry Liebel  @param  SystemContext    Register state at the time of the Exception
12925402f5d0660acde3ee382a36b065945251990dcHarry Liebel
13025402f5d0660acde3ee382a36b065945251990dcHarry Liebel**/
13125402f5d0660acde3ee382a36b065945251990dcHarry LiebelVOID
13225402f5d0660acde3ee382a36b065945251990dcHarry LiebelDefaultExceptionHandler (
13325402f5d0660acde3ee382a36b065945251990dcHarry Liebel  IN     EFI_EXCEPTION_TYPE           ExceptionType,
13425402f5d0660acde3ee382a36b065945251990dcHarry Liebel  IN OUT EFI_SYSTEM_CONTEXT           SystemContext
13525402f5d0660acde3ee382a36b065945251990dcHarry Liebel  )
13625402f5d0660acde3ee382a36b065945251990dcHarry Liebel{
13725402f5d0660acde3ee382a36b065945251990dcHarry Liebel  CHAR8  Buffer[100];
13825402f5d0660acde3ee382a36b065945251990dcHarry Liebel  UINTN  CharCount;
13925402f5d0660acde3ee382a36b065945251990dcHarry Liebel
140451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"\n\n%a Exception at 0x%016lx\n", gExceptionTypeString[ExceptionType], SystemContext.SystemContextAArch64->ELR);
14125402f5d0660acde3ee382a36b065945251990dcHarry Liebel  SerialPortWrite ((UINT8 *) Buffer, CharCount);
14225402f5d0660acde3ee382a36b065945251990dcHarry Liebel
14325402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG_CODE_BEGIN ();
14425402f5d0660acde3ee382a36b065945251990dcHarry Liebel    CHAR8  *Pdb;
14525402f5d0660acde3ee382a36b065945251990dcHarry Liebel    UINTN  ImageBase;
14625402f5d0660acde3ee382a36b065945251990dcHarry Liebel    UINTN  PeCoffSizeOfHeader;
14725402f5d0660acde3ee382a36b065945251990dcHarry Liebel    Pdb = GetImageName (SystemContext.SystemContextAArch64->ELR, &ImageBase, &PeCoffSizeOfHeader);
14825402f5d0660acde3ee382a36b065945251990dcHarry Liebel    if (Pdb != NULL) {
14925402f5d0660acde3ee382a36b065945251990dcHarry Liebel      DEBUG ((EFI_D_ERROR, "%a loaded at 0x%016lx \n", Pdb, ImageBase));
15025402f5d0660acde3ee382a36b065945251990dcHarry Liebel    }
15125402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG_CODE_END ();
15225402f5d0660acde3ee382a36b065945251990dcHarry Liebel
15325402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, "\n  X0 0x%016lx   X1 0x%016lx   X2 0x%016lx   X3 0x%016lx\n", SystemContext.SystemContextAArch64->X0, SystemContext.SystemContextAArch64->X1, SystemContext.SystemContextAArch64->X2, SystemContext.SystemContextAArch64->X3));
15425402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, "  X4 0x%016lx   X5 0x%016lx   X6 0x%016lx   X7 0x%016lx\n", SystemContext.SystemContextAArch64->X4, SystemContext.SystemContextAArch64->X5, SystemContext.SystemContextAArch64->X6, SystemContext.SystemContextAArch64->X7));
15525402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, "  X8 0x%016lx   X9 0x%016lx  X10 0x%016lx  X11 0x%016lx\n", SystemContext.SystemContextAArch64->X8, SystemContext.SystemContextAArch64->X9, SystemContext.SystemContextAArch64->X10, SystemContext.SystemContextAArch64->X11));
15625402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " X12 0x%016lx  X13 0x%016lx  X14 0x%016lx  X15 0x%016lx\n", SystemContext.SystemContextAArch64->X12, SystemContext.SystemContextAArch64->X13, SystemContext.SystemContextAArch64->X14, SystemContext.SystemContextAArch64->X15));
15725402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " X16 0x%016lx  X17 0x%016lx  X18 0x%016lx  X19 0x%016lx\n", SystemContext.SystemContextAArch64->X16, SystemContext.SystemContextAArch64->X17, SystemContext.SystemContextAArch64->X18, SystemContext.SystemContextAArch64->X19));
15825402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " X20 0x%016lx  X21 0x%016lx  X22 0x%016lx  X23 0x%016lx\n", SystemContext.SystemContextAArch64->X20, SystemContext.SystemContextAArch64->X21, SystemContext.SystemContextAArch64->X22, SystemContext.SystemContextAArch64->X23));
15925402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " X24 0x%016lx  X25 0x%016lx  X26 0x%016lx  X27 0x%016lx\n", SystemContext.SystemContextAArch64->X24, SystemContext.SystemContextAArch64->X25, SystemContext.SystemContextAArch64->X26, SystemContext.SystemContextAArch64->X27));
16025402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " X28 0x%016lx   FP 0x%016lx   LR 0x%016lx  \n", SystemContext.SystemContextAArch64->X28, SystemContext.SystemContextAArch64->FP, SystemContext.SystemContextAArch64->LR));
16125402f5d0660acde3ee382a36b065945251990dcHarry Liebel
16225402f5d0660acde3ee382a36b065945251990dcHarry Liebel  /* We save these as 128bit numbers, but have to print them as two 64bit numbers,
16325402f5d0660acde3ee382a36b065945251990dcHarry Liebel     so swap the 64bit words to correctly represent a 128bit number.  */
16425402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, "\n  V0 0x%016lx %016lx   V1 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V0[1], SystemContext.SystemContextAArch64->V0[0], SystemContext.SystemContextAArch64->V1[1], SystemContext.SystemContextAArch64->V1[0]));
16525402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, "  V2 0x%016lx %016lx   V3 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V2[1], SystemContext.SystemContextAArch64->V2[0], SystemContext.SystemContextAArch64->V3[1], SystemContext.SystemContextAArch64->V3[0]));
16625402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, "  V4 0x%016lx %016lx   V5 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V4[1], SystemContext.SystemContextAArch64->V4[0], SystemContext.SystemContextAArch64->V5[1], SystemContext.SystemContextAArch64->V5[0]));
16725402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, "  V6 0x%016lx %016lx   V7 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V6[1], SystemContext.SystemContextAArch64->V6[0], SystemContext.SystemContextAArch64->V7[1], SystemContext.SystemContextAArch64->V7[0]));
16825402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, "  V8 0x%016lx %016lx   V9 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V8[1], SystemContext.SystemContextAArch64->V8[0], SystemContext.SystemContextAArch64->V9[1], SystemContext.SystemContextAArch64->V9[0]));
16925402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " V10 0x%016lx %016lx  V11 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V10[1], SystemContext.SystemContextAArch64->V10[0], SystemContext.SystemContextAArch64->V11[1], SystemContext.SystemContextAArch64->V11[0]));
17025402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " V12 0x%016lx %016lx  V13 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V12[1], SystemContext.SystemContextAArch64->V12[0], SystemContext.SystemContextAArch64->V13[1], SystemContext.SystemContextAArch64->V13[0]));
17125402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " V14 0x%016lx %016lx  V15 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V14[1], SystemContext.SystemContextAArch64->V14[0], SystemContext.SystemContextAArch64->V15[1], SystemContext.SystemContextAArch64->V15[0]));
17225402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " V16 0x%016lx %016lx  V17 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V16[1], SystemContext.SystemContextAArch64->V16[0], SystemContext.SystemContextAArch64->V17[1], SystemContext.SystemContextAArch64->V17[0]));
17325402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " V18 0x%016lx %016lx  V19 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V18[1], SystemContext.SystemContextAArch64->V18[0], SystemContext.SystemContextAArch64->V19[1], SystemContext.SystemContextAArch64->V19[0]));
17425402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " V20 0x%016lx %016lx  V21 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V20[1], SystemContext.SystemContextAArch64->V20[0], SystemContext.SystemContextAArch64->V21[1], SystemContext.SystemContextAArch64->V21[0]));
17525402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " V22 0x%016lx %016lx  V23 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V22[1], SystemContext.SystemContextAArch64->V22[0], SystemContext.SystemContextAArch64->V23[1], SystemContext.SystemContextAArch64->V23[0]));
17625402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " V24 0x%016lx %016lx  V25 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V24[1], SystemContext.SystemContextAArch64->V24[0], SystemContext.SystemContextAArch64->V25[1], SystemContext.SystemContextAArch64->V25[0]));
17725402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " V26 0x%016lx %016lx  V27 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V26[1], SystemContext.SystemContextAArch64->V26[0], SystemContext.SystemContextAArch64->V27[1], SystemContext.SystemContextAArch64->V27[0]));
17825402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " V28 0x%016lx %016lx  V29 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V28[1], SystemContext.SystemContextAArch64->V28[0], SystemContext.SystemContextAArch64->V29[1], SystemContext.SystemContextAArch64->V29[0]));
17925402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, " V30 0x%016lx %016lx  V31 0x%016lx %016lx\n", SystemContext.SystemContextAArch64->V30[1], SystemContext.SystemContextAArch64->V30[0], SystemContext.SystemContextAArch64->V31[1], SystemContext.SystemContextAArch64->V31[0]));
18025402f5d0660acde3ee382a36b065945251990dcHarry Liebel
18125402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, "\n  SP 0x%016lx  ELR 0x%016lx  SPSR 0x%08lx  FPSR 0x%08lx\n ESR 0x%08lx          FAR 0x%016lx\n", SystemContext.SystemContextAArch64->SP, SystemContext.SystemContextAArch64->ELR, SystemContext.SystemContextAArch64->SPSR, SystemContext.SystemContextAArch64->FPSR, SystemContext.SystemContextAArch64->ESR, SystemContext.SystemContextAArch64->FAR));
18225402f5d0660acde3ee382a36b065945251990dcHarry Liebel
18325402f5d0660acde3ee382a36b065945251990dcHarry Liebel  DEBUG ((EFI_D_ERROR, "\n ESR : EC 0x%02x  IL 0x%x  ISS 0x%08x\n", (SystemContext.SystemContextAArch64->ESR & 0xFC000000) >> 26, (SystemContext.SystemContextAArch64->ESR >> 25) & 0x1, SystemContext.SystemContextAArch64->ESR & 0x1FFFFFF ));
18425402f5d0660acde3ee382a36b065945251990dcHarry Liebel
185451b665890f69244f213d7aba4450394a21bc60cOlivier Martin  DescribeExceptionSyndrome (SystemContext.SystemContextAArch64->ESR);
18625402f5d0660acde3ee382a36b065945251990dcHarry Liebel  ASSERT (FALSE);
18725402f5d0660acde3ee382a36b065945251990dcHarry Liebel}
188