Setting up repository
[linux-libre-firmware.git] / ath9k_htc / sboot / magpie_1_1 / sboot / athos / src / xtos / int-handler.S
1 // int-handler.S  -  Interrupt Handler Template (for levels > 1)
2 // $Id: //depot/main/Xtensa/OS/xtos/inth-template.S#1 $
3
4 // Copyright (c) 2003-2004, 2006 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 priority level of the vector, then include this file.
28 // The default Makefile defines _INTERRUPT_LEVEL when assembling this file
29 // for each medium and high priority interrupt level.
30
31
32 #include <xtensa/coreasm.h>
33 #include "xtos-internal.h"
34
35
36 #if XCHAL_HAVE_INTERRUPTS
37
38 # if INTERRUPT_IS_HI(_INTERRUPT_LEVEL)
39
40 #  if _INTERRUPT_LEVEL > XTOS_LOCKLEVEL
41    /*  Not safe to dispatch interrupts in C above XTOS_LOCKLEVEL,
42     *  so default to assembly high-priority interrupt handlers template
43     *  in this case (with the default XTOS_LOCKLEVEL this never happens):
44     */
45 #   include "int-highpri-template.S"
46 #  else
47    /*  Dispatch high-priority interrupt handlers in C:  */
48 #   include "int-highpri-dispatcher.S"
49 #  endif
50
51 # elif INTERRUPT_IS_MED(_INTERRUPT_LEVEL)
52
53 #  include "int-medpri-dispatcher.S"
54
55 # elif (_INTERRUPT_LEVEL <= XCHAL_NUM_INTLEVELS) && (_INTERRUPT_LEVEL != XCHAL_DEBUGLEVEL)
56 # error INTERNAL ERROR: Interrupt priority levels > 1 must be either hi or medium priority!
57 # endif
58
59 #endif /* XCHAL_HAVE_INTERRUPTS */