1 // reloc-vector.S - Relocatable Vectors section
2 // $Id: //depot/rel/Cottonwood/Xtensa/OS/xtos/reloc-vectors.S#3 $
4 // Copyright (c) 2007-2010 Tensilica Inc.
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:
14 // The above copyright notice and this permission notice shall be included
15 // in all copies or substantial portions of the Software.
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.
26 * This file is only used if the relocatable vectors option is enabled.
29 #include <xtensa/coreasm.h>
30 #include <xtensa/config/system.h>
32 #if XCHAL_HAVE_VECBASE
34 .section .RelocatableVectors.text, "ax"
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
47 # if XCHAL_HAVE_WINDOWED
48 # define NO_SECTION_DIRECTIVES 1
49 # define WINDOW_BASE_VECOFS 0
50 # include "window-vectors.S"
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
67 # if XCHAL_HAVE_INTERRUPTS
68 # if XCHAL_NUM_INTLEVELS >= 2
69 .org XCHAL_INTLEVEL2_VECOFS
72 # if XCHAL_NUM_INTLEVELS >= 3
73 .org XCHAL_INTLEVEL3_VECOFS
76 # if XCHAL_NUM_INTLEVELS >= 4
77 .org XCHAL_INTLEVEL4_VECOFS
80 # if XCHAL_NUM_INTLEVELS >= 5
81 .org XCHAL_INTLEVEL5_VECOFS
84 # if XCHAL_NUM_INTLEVELS >= 6
85 .org XCHAL_INTLEVEL6_VECOFS
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
102 // Put literals here.
104 // Put actual handlers here.
108 .literal rvec, _ResetVector
114 .size _RelocVectors, . - _RelocVectors
118 #endif /* XCHAL_HAVE_VECBASE */