1 // nmi-vector.S -- Standalone NMI Interrupt Vector/Handler
2 // $Id: //depot/rel/Cottonwood/Xtensa/OS/xtos/nmi-vector.S#3 $
4 // Copyright (c) 2003, 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.
25 // The NMI exception vector handles non-maskable interrupts.
27 #include <xtensa/coreasm.h>
28 #include <xtensa/config/system.h>
29 #include <xtensa/config/specreg.h>
33 .begin literal_prefix .NMIExceptionVector
34 .section .NMIExceptionVector.text, "ax"
37 .global _NMIExceptionVector
40 // Insert any custom NMI handling code here.
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
46 // do something useful ...
48 // l32i a1, a0, 0 // restore whatever registers were saved
49 // rsr a0, EXCSAVE+XCHAL_NMILEVEL
51 // This default NMI handler does not do anything. It just returns
52 // immediately upon any occurrence of a non-maskable interrupt.
56 .size _NMIExceptionVector, . - _NMIExceptionVector
60 #endif /* XCHAL_HAVE_NMI */