Setting up repository
[linux-libre-firmware.git] / ath9k_htc / sboot / magpie_1_1 / sboot / athos / src / xtos / nmi-vector.S
1 // nmi-vector.S  --  Standalone NMI Interrupt Vector/Handler
2 // $Id: //depot/rel/Cottonwood/Xtensa/OS/xtos/nmi-vector.S#3 $
3
4 // Copyright (c) 2003, 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 // The NMI exception vector handles non-maskable interrupts.
26
27 #include <xtensa/coreasm.h>
28 #include <xtensa/config/system.h>
29 #include <xtensa/config/specreg.h>
30
31 #if XCHAL_HAVE_NMI
32
33         .begin  literal_prefix  .NMIExceptionVector
34         .section                .NMIExceptionVector.text, "ax"
35
36         .align  4
37         .global _NMIExceptionVector
38 _NMIExceptionVector:
39
40 //  Insert any custom NMI handling code here.
41 //  For example:
42 //      wsr     a0, EXCSAVE+XCHAL_NMILEVEL
43 //      movi    a0, ...address of some save area specific to this code...
44 //      s32i    a1, a0, 0       // save whatever registers are needed
45 //      :
46 //      do something useful ...
47 //      :
48 //      l32i    a1, a0, 0       // restore whatever registers were saved
49 //      rsr     a0, EXCSAVE+XCHAL_NMILEVEL
50 //
51 //  This default NMI handler does not do anything.  It just returns
52 //  immediately upon any occurrence of a non-maskable interrupt.
53
54         rfi     XCHAL_NMILEVEL
55
56         .size   _NMIExceptionVector, . - _NMIExceptionVector
57         .text
58         .end    literal_prefix
59
60 #endif /* XCHAL_HAVE_NMI */
61