Setting up repository
[linux-libre-firmware.git] / ath9k_htc / sboot / magpie_1_1 / sboot / athos / src / xtos / reloc-vectors.S
1 // reloc-vector.S  -  Relocatable Vectors section
2 // $Id: //depot/rel/Cottonwood/Xtensa/OS/xtos/reloc-vectors.S#3 $
3
4 // Copyright (c) 2007-2010 Tensilica Inc.
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining
7 // a copy of this software and associated documentation files (the
8 // "Software"), to deal in the Software without restriction, including
9 // without limitation the rights to use, copy, modify, merge, publish,
10 // distribute, sublicense, and/or sell copies of the Software, and to
11 // permit persons to whom the Software is furnished to do so, subject to
12 // the following conditions:
13 //
14 // The above copyright notice and this permission notice shall be included
15 // in all copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25 /*
26  *  This file is only used if the relocatable vectors option is enabled.
27  */
28
29 #include <xtensa/coreasm.h>
30 #include <xtensa/config/system.h>
31
32 #if XCHAL_HAVE_VECBASE
33
34         .section        .RelocatableVectors.text, "ax"
35
36         .global _RelocVectors
37 _RelocVectors:
38
39 //if XCHAL_RESET_VECBASE_OVERLAP ...
40 # if XSHAL_VECTORS_PACKED \
41   && (XCHAL_RESET_VECTOR0_VADDR == XCHAL_VECBASE_RESET_VADDR \
42    || XCHAL_RESET_VECTOR1_VADDR == XCHAL_VECBASE_RESET_VADDR)
43 #  define JUMP_TO_RESET 1
44         j       .Ljump_to_reset
45 # endif
46
47 # if XCHAL_HAVE_WINDOWED
48 #  define NO_SECTION_DIRECTIVES 1
49 #  define WINDOW_BASE_VECOFS    0
50 #  include "window-vectors.S"
51 # endif
52
53 #if XCHAL_HAVE_DEBUG && XCHAL_HAVE_EXCEPTIONS
54 # if XCHAL_DEBUGLEVEL == 2
55 #  define _Level2Vector _DebugExceptionVector
56 # elif XCHAL_DEBUGLEVEL == 3
57 #  define _Level3Vector _DebugExceptionVector
58 # elif XCHAL_DEBUGLEVEL == 4
59 #  define _Level4Vector _DebugExceptionVector
60 # elif XCHAL_DEBUGLEVEL == 5
61 #  define _Level5Vector _DebugExceptionVector
62 # elif XCHAL_DEBUGLEVEL == 6
63 #  define _Level6Vector _DebugExceptionVector
64 # endif
65 #endif
66
67 # if XCHAL_HAVE_INTERRUPTS
68 #  if XCHAL_NUM_INTLEVELS >= 2
69         .org    XCHAL_INTLEVEL2_VECOFS
70         j       _Level2Vector
71 #  endif
72 #  if XCHAL_NUM_INTLEVELS >= 3
73         .org    XCHAL_INTLEVEL3_VECOFS
74         j       _Level3Vector
75 #  endif
76 #  if XCHAL_NUM_INTLEVELS >= 4
77         .org    XCHAL_INTLEVEL4_VECOFS
78         j       _Level4Vector
79 #  endif
80 #  if XCHAL_NUM_INTLEVELS >= 5
81         .org    XCHAL_INTLEVEL5_VECOFS
82         j       _Level5Vector
83 #  endif
84 #  if XCHAL_NUM_INTLEVELS >= 6
85         .org    XCHAL_INTLEVEL6_VECOFS
86         j       _Level6Vector
87 #  endif
88 #  if XCHAL_HAVE_NMI
89         .org    XCHAL_NMI_VECOFS
90         j       _NMIExceptionVector
91 #  endif
92 # endif
93 # if XCHAL_HAVE_EXCEPTIONS
94         .org    XCHAL_KERNEL_VECOFS
95         j       _KernelExceptionVector
96         .org    XCHAL_USER_VECOFS
97         j       _UserExceptionVector
98         .org    XCHAL_DOUBLEEXC_VECOFS
99         j       _DoubleExceptionVector
100 # endif
101
102 //      Put literals here.
103
104 //      Put actual handlers here.
105
106 # if JUMP_TO_RESET
107         .align  4
108         .literal        rvec, _ResetVector
109 .Ljump_to_reset:
110         l32r    a2, rvec
111         jx      a2
112 # endif
113
114         .size   _RelocVectors, . - _RelocVectors
115
116         .text
117
118 #endif /* XCHAL_HAVE_VECBASE */
119