]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/PrePeiCore/Arm/ArchPrePeiCore.c
ArmPlatformPkg: Moved ARMv7 specific files to a 'Arm' subdirectory
[mirror_edk2.git] / ArmPlatformPkg / PrePeiCore / Arm / ArchPrePeiCore.c
diff --git a/ArmPlatformPkg/PrePeiCore/Arm/ArchPrePeiCore.c b/ArmPlatformPkg/PrePeiCore/Arm/ArchPrePeiCore.c
new file mode 100644 (file)
index 0000000..b0594ae
--- /dev/null
@@ -0,0 +1,62 @@
+/** @file\r
+*  Main file supporting the transition to PEI Core in Normal World for Versatile Express\r
+*\r
+*  Copyright (c) 2012, ARM Limited. All rights reserved.\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
+*\r
+**/\r
+\r
+#include <Library/PrintLib.h>\r
+#include <Library/SerialPortLib.h>\r
+\r
+#include "PrePeiCore.h"\r
+\r
+VOID\r
+PeiCommonExceptionEntry (\r
+  IN UINT32 Entry,\r
+  IN UINTN LR\r
+  )\r
+{\r
+  CHAR8           Buffer[100];\r
+  UINTN           CharCount;\r
+\r
+  switch (Entry) {\r
+  case 0:\r
+    CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Reset Exception at 0x%X\n\r",LR);\r
+    break;\r
+  case 1:\r
+    CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Undefined Exception at 0x%X\n\r",LR);\r
+    break;\r
+  case 2:\r
+    CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"SWI Exception at 0x%X\n\r",LR);\r
+    break;\r
+  case 3:\r
+    CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"PrefetchAbort Exception at 0x%X\n\r",LR);\r
+    break;\r
+  case 4:\r
+    CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"DataAbort Exception at 0x%X\n\r",LR);\r
+    break;\r
+  case 5:\r
+    CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Reserved Exception at 0x%X\n\r",LR);\r
+    break;\r
+  case 6:\r
+    CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"IRQ Exception at 0x%X\n\r",LR);\r
+    break;\r
+  case 7:\r
+    CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"FIQ Exception at 0x%X\n\r",LR);\r
+    break;\r
+  default:\r
+    CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Unknown Exception at 0x%X\n\r",LR);\r
+    break;\r
+  }\r
+  SerialPortWrite ((UINT8 *) Buffer, CharCount);\r
+  while(1);\r
+}\r
+\r