]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/PrePeiCore/Arm/Exception.S
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ArmPlatformPkg / PrePeiCore / Arm / Exception.S
1 //
2 // Copyright (c) 2011, ARM Limited. All rights reserved.
3 //
4 # SPDX-License-Identifier: BSD-2-Clause-Patent
5 #
6 #
7
8 #include <AsmMacroIoLib.h>
9 #include <Base.h>
10 #include <AutoGen.h>
11
12 #start of the code section
13 .text
14 .align 5
15
16 # IMPORT
17 GCC_ASM_IMPORT(PeiCommonExceptionEntry)
18
19 # EXPORT
20 GCC_ASM_EXPORT(PeiVectorTable)
21
22 //============================================================
23 //Default Exception Handlers
24 //============================================================
25
26
27 ASM_PFX(PeiVectorTable):
28 b _DefaultResetHandler
29 b _DefaultUndefined
30 b _DefaultSWI
31 b _DefaultPrefetchAbort
32 b _DefaultDataAbort
33 b _DefaultReserved
34 b _DefaultIrq
35 b _DefaultFiq
36
37 //
38 // Default Exception handlers: There is no plan to return from any of these exceptions.
39 // No context saving at all.
40 //
41 _DefaultResetHandler:
42 mov r1, lr
43 # Switch to SVC for common stack
44 cps #0x13
45 mov r0, #0
46 blx ASM_PFX(PeiCommonExceptionEntry)
47
48 _DefaultUndefined:
49 sub r1, LR, #4
50 # Switch to SVC for common stack
51 cps #0x13
52 mov r0, #1
53 blx ASM_PFX(PeiCommonExceptionEntry)
54
55 _DefaultSWI:
56 sub r1, LR, #4
57 # Switch to SVC for common stack
58 cps #0x13
59 mov r0, #2
60 blx ASM_PFX(PeiCommonExceptionEntry)
61
62 _DefaultPrefetchAbort:
63 sub r1, LR, #4
64 # Switch to SVC for common stack
65 cps #0x13
66 mov r0, #3
67 blx ASM_PFX(PeiCommonExceptionEntry)
68
69 _DefaultDataAbort:
70 sub r1, LR, #8
71 # Switch to SVC for common stack
72 cps #0x13
73 mov r0, #4
74 blx ASM_PFX(PeiCommonExceptionEntry)
75
76 _DefaultReserved:
77 mov r1, lr
78 # Switch to SVC for common stack
79 cps #0x13
80 mov r0, #5
81 blx ASM_PFX(PeiCommonExceptionEntry)
82
83 _DefaultIrq:
84 sub r1, LR, #4
85 # Switch to SVC for common stack
86 cps #0x13
87 mov r0, #6
88 blx ASM_PFX(PeiCommonExceptionEntry)
89
90 _DefaultFiq:
91 sub r1, LR, #4
92 # Switch to SVC for common stack
93 cps #0x13
94 mov r0, #7
95 blx ASM_PFX(PeiCommonExceptionEntry)
96