ArchPrePeiCore.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /** @file
  2. * Main file supporting the transition to PEI Core in Normal World for Versatile Express
  3. *
  4. * Copyright (c) 2012-2013, ARM Limited. All rights reserved.
  5. *
  6. * SPDX-License-Identifier: BSD-2-Clause-Patent
  7. *
  8. **/
  9. #include <Library/PrintLib.h>
  10. #include <Library/SerialPortLib.h>
  11. #include "PrePeiCore.h"
  12. VOID
  13. PeiCommonExceptionEntry (
  14. IN UINT32 Entry,
  15. IN UINTN LR
  16. )
  17. {
  18. CHAR8 Buffer[100];
  19. UINTN CharCount;
  20. switch (Entry) {
  21. case EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS:
  22. CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Synchronous Exception at 0x%X\n\r", LR);
  23. break;
  24. case EXCEPT_AARCH64_IRQ:
  25. CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"IRQ Exception at 0x%X\n\r", LR);
  26. break;
  27. case EXCEPT_AARCH64_FIQ:
  28. CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"FIQ Exception at 0x%X\n\r", LR);
  29. break;
  30. case EXCEPT_AARCH64_SERROR:
  31. CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"SError/Abort Exception at 0x%X\n\r", LR);
  32. break;
  33. default:
  34. CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Unknown Exception at 0x%X\n\r", LR);
  35. break;
  36. }
  37. SerialPortWrite ((UINT8 *) Buffer, CharCount);
  38. while(1);
  39. }