]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/PrePeiCore/Exception.S
Add ArmPlatformPkg from ARM Ltd. patch.
[mirror_edk2.git] / ArmPlatformPkg / PrePeiCore / Exception.S
1 //
2 // Copyright (c) 2011, ARM Limited. All rights reserved.
3 //
4 # This program and the accompanying materials
5 # are licensed and made available under the terms and conditions of the BSD License
6 # which accompanies this distribution. The full text of the license may be found at
7 # http://opensource.org/licenses/bsd-license.php
8 #
9 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 #
12 #
13
14 #include <AsmMacroIoLib.h>
15 #include <Base.h>
16 #include <AutoGen.h>
17
18 #start of the code section
19 .text
20 .align 5
21
22 # IMPORT
23 GCC_ASM_IMPORT(PeiCommonExceptionEntry)
24
25 # EXPORT
26 GCC_ASM_EXPORT(PeiVectorTable)
27
28 //============================================================
29 //Default Exception Handlers
30 //============================================================
31
32 //FIXME: One of the EDK2 tool is broken. It does not look to respect the alignment. Even, if we specify 32-byte alignment for this file.
33 Dummy1: .word 0
34 Dummy2: .word 0
35
36 ASM_PFX(PeiVectorTable):
37 b _DefaultResetHandler
38 b _DefaultUndefined
39 b _DefaultSWI
40 b _DefaultPrefetchAbort
41 b _DefaultDataAbort
42 b _DefaultReserved
43 b _DefaultIrq
44 b _DefaultFiq
45
46 //
47 // Default Exception handlers: There is no plan to return from any of these exceptions.
48 // No context saving at all.
49 //
50 _DefaultResetHandler:
51 mov r1, lr
52 # Switch to SVC for common stack
53 cps #0x13
54 mov r0, #0
55 blx ASM_PFX(PeiCommonExceptionEntry)
56
57 _DefaultUndefined:
58 sub r1, LR, #4
59 # Switch to SVC for common stack
60 cps #0x13
61 mov r0, #1
62 blx ASM_PFX(PeiCommonExceptionEntry)
63
64 _DefaultSWI:
65 sub r1, LR, #4
66 # Switch to SVC for common stack
67 cps #0x13
68 mov r0, #2
69 blx ASM_PFX(PeiCommonExceptionEntry)
70
71 _DefaultPrefetchAbort:
72 sub r1, LR, #4
73 # Switch to SVC for common stack
74 cps #0x13
75 mov r0, #3
76 blx ASM_PFX(PeiCommonExceptionEntry)
77
78 _DefaultDataAbort:
79 sub r1, LR, #8
80 # Switch to SVC for common stack
81 cps #0x13
82 mov r0, #4
83 blx ASM_PFX(PeiCommonExceptionEntry)
84
85 _DefaultReserved:
86 mov r1, lr
87 # Switch to SVC for common stack
88 cps #0x13
89 mov r0, #5
90 blx PeiCommonExceptionEntry
91
92 _DefaultIrq:
93 sub r1, LR, #4
94 # Switch to SVC for common stack
95 cps #0x13
96 mov r0, #6
97 blx PeiCommonExceptionEntry
98
99 _DefaultFiq:
100 sub r1, LR, #4
101 # Switch to SVC for common stack
102 cps #0x13
103 mov r0, #7
104 blx PeiCommonExceptionEntry
105
106 .end