Setting up repository
[linux-libre-firmware.git] / ath9k_htc / sboot / magpie_1_1 / sboot / athos / src / xtos / int-vector.S
1 // int-vector.S  -  Interrupt Vector Template (for levels > 1)
2 // $Id: //depot/rel/Cottonwood/Xtensa/OS/xtos/int-vector.S#3 $
3
4 // Copyright (c) 2003-2004, 2006, 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 // 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.
30
31
32 #define _ASMLANGUAGE
33 #include "xtos-internal.h"
34 #include <xtensa/config/system.h>
35
36
37 #if XCHAL_HAVE_INTERRUPTS && (_INTERRUPT_LEVEL <= XCHAL_NUM_INTLEVELS) && (_INTERRUPT_LEVEL != XCHAL_DEBUGLEVEL)
38
39         .begin  literal_prefix  LABEL(.Level,InterruptVector)
40         .section                LABEL(.Level,InterruptVector.text), "ax"
41         .align 4
42         .global LABEL(_Level,Vector)
43 LABEL(_Level,Vector):
44         //  Medium and high priority interrupt vector:
45
46 # if HAVE_XSR
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:
51         xsr     a2, EXCSAVE_LEVEL
52         jx      a2
53
54         //  Pull-in the real handler by reference, to ensure the reset epilog gets it:
55         .global LABEL(_Level,FromVector)
56
57 # else
58         wsr     a2, EXCSAVE_LEVEL
59         movi    a2, LABEL(_Level,FromVector)
60         jx      a2
61 # endif
62
63         .size   LABEL(_Level,Vector), . - LABEL(_Level,Vector)
64         .text
65         .end    literal_prefix
66
67 #endif /* interrupt at that level */
68