]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/PrePi/Exception.asm
ArmPlatformPkg: Introduce ArmPlatformGlobalVariableLib
[mirror_edk2.git] / ArmPlatformPkg / PrePi / Exception.asm
CommitLineData
cd872e40 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 PrePiCommonExceptionEntry
19 EXPORT PrePiVectorTable
20
21 PRESERVE8
22 AREA PrePeiCoreException, CODE, READONLY, CODEALIGN, ALIGN=5
23
24//============================================================
25//Default Exception Handlers
26//============================================================
27//TODO: there should be better way to handle the exceptions during the early stage. At the moment they are spinning in infinite loop
28
29PrePiVectorTable
30 b _DefaultResetHandler
31 b _DefaultUndefined
32 b _DefaultSWI
33 b _DefaultPrefetchAbort
34 b _DefaultDataAbort
35 b _DefaultReserved
36 b _DefaultIrq
37 b _DefaultFiq
38
39//
40// Default Exception handlers: There is no plan to return from any of these exceptions.
41// No context saving at all.
42//
43_DefaultResetHandler
44 mov r1, lr
45 cps #0x13 ; Switch to SVC for common stack
46 mov r0, #0
47 blx PrePiCommonExceptionEntry
48
49_DefaultUndefined
50 sub r1, LR, #4
51 cps #0x13 ; Switch to SVC for common stack
52 mov r0, #1
53 blx PrePiCommonExceptionEntry
54
55_DefaultSWI
56 sub r1, LR, #4
57 cps #0x13 ; Switch to SVC for common stack
58 mov r0, #2
59 blx PrePiCommonExceptionEntry
60
61_DefaultPrefetchAbort
62 sub r1, LR, #4
63 cps #0x13 ; Switch to SVC for common stack
64 mov r0, #3
65 blx PrePiCommonExceptionEntry
66
67_DefaultDataAbort
68 sub r1, LR, #8
69 cps #0x13 ; Switch to SVC for common stack
70 mov r0, #4
71 blx PrePiCommonExceptionEntry
72
73_DefaultReserved
74 mov r1, lr
75 cps #0x13 ; Switch to SVC for common stack
76 mov r0, #5
77 blx PrePiCommonExceptionEntry
78
79_DefaultIrq
80 sub r1, LR, #4
81 cps #0x13 ; Switch to SVC for common stack
82 mov r0, #6
83 blx PrePiCommonExceptionEntry
84
85_DefaultFiq
86 sub r1, LR, #4
87 cps #0x13 ; Switch to SVC for common stack
88 mov r0, #7
89 blx PrePiCommonExceptionEntry
90
91 END