]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/Sec/Exception.asm
Add ArmPlatformPkg from ARM Ltd. patch.
[mirror_edk2.git] / ArmPlatformPkg / Sec / Exception.asm
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 IMPORT SecCommonExceptionEntry
19 EXPORT SecVectorTable
20
21 PRESERVE8
22 AREA SecException, CODE, READONLY, CODEALIGN, ALIGN=5
23
24 //============================================================
25 //Default Exception Handlers
26 //============================================================
27
28 //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.
29 Dummy1 DCD 0
30 Dummy2 DCD 0
31
32 SecVectorTable
33 b _DefaultResetHandler
34 b _DefaultUndefined
35 b _DefaultSWI
36 b _DefaultPrefetchAbort
37 b _DefaultDataAbort
38 b _DefaultReserved
39 b _DefaultIrq
40 b _DefaultFiq
41
42 //
43 // Default Exception handlers: There is no plan to return from any of these exceptions.
44 // No context saving at all.
45 //
46 _DefaultResetHandler
47 mov r1, lr
48 cps #0x13 ; Switch to SVC for common stack
49 mov r0, #0
50 blx SecCommonExceptionEntry
51
52 _DefaultUndefined
53 sub r1, LR
54 cps #0x13 ; Switch to SVC for common stack
55 mov r0, #1
56 blx SecCommonExceptionEntry
57
58 _DefaultSWI
59 sub r1, LR, #4
60 cps #0x13 ; Switch to SVC for common stack
61 mov r0, #2
62 blx SecCommonExceptionEntry
63
64 _DefaultPrefetchAbort
65 sub r1, LR, #4
66 cps #0x13 ; Switch to SVC for common stack
67 mov r0, #3
68 blx SecCommonExceptionEntry
69
70 _DefaultDataAbort
71 sub r1, LR, #8
72 cps #0x13 ; Switch to SVC for common stack
73 mov r0, #4
74 blx SecCommonExceptionEntry
75
76 _DefaultReserved
77 mov r1, lr
78 cps #0x13 ; Switch to SVC for common stack
79 mov r0, #5
80 blx SecCommonExceptionEntry
81
82 _DefaultIrq
83 sub r1, LR, #4
84 cps #0x13 ; Switch to SVC for common stack
85 mov r0, #6
86 blx SecCommonExceptionEntry
87
88 _DefaultFiq
89 sub r1, LR, #4
90 cps #0x13 ; Switch to SVC for common stack
91 mov r0, #7
92 blx SecCommonExceptionEntry
93
94 END