]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/PrePeiCore/Arm/ArchPrePeiCore.c
ArmPlatformPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / ArmPlatformPkg / PrePeiCore / Arm / ArchPrePeiCore.c
CommitLineData
a9d7090f 1/** @file\r
2* Main file supporting the transition to PEI Core in Normal World for Versatile Express\r
3*\r
4* Copyright (c) 2012, ARM Limited. All rights reserved.\r
a9d7090f 5*\r
f4dfad05 6* SPDX-License-Identifier: BSD-2-Clause-Patent\r
a9d7090f 7*\r
8**/\r
9\r
10#include <Library/PrintLib.h>\r
11#include <Library/SerialPortLib.h>\r
12\r
13#include "PrePeiCore.h"\r
14\r
15VOID\r
16PeiCommonExceptionEntry (\r
17 IN UINT32 Entry,\r
18 IN UINTN LR\r
19 )\r
20{\r
21 CHAR8 Buffer[100];\r
22 UINTN CharCount;\r
23\r
24 switch (Entry) {\r
25 case 0:\r
26 CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Reset Exception at 0x%X\n\r",LR);\r
27 break;\r
28 case 1:\r
29 CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Undefined Exception at 0x%X\n\r",LR);\r
30 break;\r
31 case 2:\r
32 CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"SWI Exception at 0x%X\n\r",LR);\r
33 break;\r
34 case 3:\r
35 CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"PrefetchAbort Exception at 0x%X\n\r",LR);\r
36 break;\r
37 case 4:\r
38 CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"DataAbort Exception at 0x%X\n\r",LR);\r
39 break;\r
40 case 5:\r
41 CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Reserved Exception at 0x%X\n\r",LR);\r
42 break;\r
43 case 6:\r
44 CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"IRQ Exception at 0x%X\n\r",LR);\r
45 break;\r
46 case 7:\r
47 CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"FIQ Exception at 0x%X\n\r",LR);\r
48 break;\r
49 default:\r
50 CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Unknown Exception at 0x%X\n\r",LR);\r
51 break;\r
52 }\r
53 SerialPortWrite ((UINT8 *) Buffer, CharCount);\r
54 while(1);\r
55}\r
56\r