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 <AutoGen.h>
15
16  IMPORT  PeiCommonExceptionEntry
17  EXPORT  PeiVectorTable
18
19  PRESERVE8
20  AREA    PrePeiCoreException, CODE, READONLY, CODEALIGN, ALIGN=5
21
22//============================================================
23//Default Exception Handlers
24//============================================================
25
26
27PeiVectorTable
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   cps       #0x13                     ; Switch to SVC for common stack
44   mov  r0, #0
45   blx   PeiCommonExceptionEntry
46
47_DefaultUndefined
48   sub  r1, LR, #4
49   cps       #0x13                     ; Switch to SVC for common stack
50   mov  r0, #1
51   blx   PeiCommonExceptionEntry
52
53_DefaultSWI
54   sub  r1, LR, #4
55   cps       #0x13                     ; Switch to SVC for common stack
56   mov  r0, #2
57   blx   PeiCommonExceptionEntry
58
59_DefaultPrefetchAbort
60   sub  r1, LR, #4
61   cps       #0x13                     ; Switch to SVC for common stack
62   mov  r0, #3
63   blx   PeiCommonExceptionEntry
64
65_DefaultDataAbort
66   sub  r1, LR, #8
67   cps       #0x13                     ; Switch to SVC for common stack
68   mov  r0, #4
69   blx   PeiCommonExceptionEntry
70
71_DefaultReserved
72   mov  r1, lr
73   cps       #0x13                     ; Switch to SVC for common stack
74   mov  r0, #5
75   blx   PeiCommonExceptionEntry
76
77_DefaultIrq
78   sub  r1, LR, #4
79   cps       #0x13                     ; Switch to SVC for common stack
80   mov  r0, #6
81   blx   PeiCommonExceptionEntry
82
83_DefaultFiq
84   sub  r1, LR, #4
85   cps       #0x13                     ; Switch to SVC for common stack
86   mov  r0, #7
87   blx   PeiCommonExceptionEntry
88
89  END
90