1 // int-vector.S - Interrupt Vector Template (for levels > 1)
2 // $Id: //depot/rel/Cottonwood/Xtensa/OS/xtos/int-vector.S#3 $
4 // Copyright (c) 2003-2004, 2006, 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 // To use this template file, define a macro called _INTERRUPT_LEVEL
27 // to be the interrupt level of the vector, include "xtos-internal.h",
28 // then include this file. We use the same template for both high-level
29 // and medium-level interrupts, but not debug level.
33 #include "xtos-internal.h"
34 #include <xtensa/config/system.h>
37 #if XCHAL_HAVE_INTERRUPTS && (_INTERRUPT_LEVEL <= XCHAL_NUM_INTLEVELS) && (_INTERRUPT_LEVEL != XCHAL_DEBUGLEVEL)
39 .begin literal_prefix LABEL(.Level,InterruptVector)
40 .section LABEL(.Level,InterruptVector.text), "ax"
42 .global LABEL(_Level,Vector)
44 // Medium and high priority interrupt vector:
47 // With XSR, we can use this vector which has the advantage of being ROMable
48 // without requiring the handler to also be in ROM; however, it requires
49 // initializing the EXCSAVEn register (see ResetEpilog.S) and a slightly
50 // different save/restore sequence in the handler:
54 // Pull-in the real handler by reference, to ensure the reset epilog gets it:
55 .global LABEL(_Level,FromVector)
59 movi a2, LABEL(_Level,FromVector)
63 .size LABEL(_Level,Vector), . - LABEL(_Level,Vector)
67 #endif /* interrupt at that level */