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