| 1 | /* Default interrupt table for CRIS/CRISv32. | 
|---|
| 2 |    Copyright (C) 2007 Axis Communications. | 
|---|
| 3 |    All rights reserved. | 
|---|
| 4 |  | 
|---|
| 5 |    Redistribution and use in source and binary forms, with or without | 
|---|
| 6 |    modification, are permitted provided that the following conditions | 
|---|
| 7 |    are met: | 
|---|
| 8 |  | 
|---|
| 9 |    1. Redistributions of source code must retain the above copyright | 
|---|
| 10 |       notice, this list of conditions and the following disclaimer. | 
|---|
| 11 |  | 
|---|
| 12 |    2. Neither the name of Axis Communications nor the names of its | 
|---|
| 13 |       contributors may be used to endorse or promote products derived | 
|---|
| 14 |       from this software without specific prior written permission. | 
|---|
| 15 |  | 
|---|
| 16 |    THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS | 
|---|
| 17 |    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 
|---|
| 18 |    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 
|---|
| 19 |    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS | 
|---|
| 20 |    COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | 
|---|
| 21 |    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 
|---|
| 22 |    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 
|---|
| 23 |    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 
|---|
| 24 |    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 
|---|
| 25 |    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 
|---|
| 26 |    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 
|---|
| 27 |    POSSIBILITY OF SUCH DAMAGE.  */ | 
|---|
| 28 |  | 
|---|
| 29 | #ifdef __ELF__ | 
|---|
| 30 |  .section .startup,"ax" | 
|---|
| 31 | #else | 
|---|
| 32 |  .text | 
|---|
| 33 | #endif | 
|---|
| 34 |  | 
|---|
| 35 | #if defined (__ELF__) || defined (IN_CRT0) | 
|---|
| 36 | ; This is included from crt0.S for a.out, as we can't have it as | 
|---|
| 37 | ; a separate object file in a library due to the lack of named | 
|---|
| 38 | ; section support and the required placement at address 3*4. | 
|---|
| 39 |  | 
|---|
| 40 | ; We define an interrupt table with references to the symbols | 
|---|
| 41 | ; _.irq_XX where XX are hex numbers 3..ff (lower-case).  They | 
|---|
| 42 | ; are satisfied by weak aliases to the _.irq stub function in | 
|---|
| 43 | ; this file.  When overridden, the overriding function must be | 
|---|
| 44 | ; in code explicitly linked in, i.e. *not* in a library. | 
|---|
| 45 |  | 
|---|
| 46 |  .global __irqtable_at_irq3 | 
|---|
| 47 | __irqtable_at_irq3: | 
|---|
| 48 |  | 
|---|
| 49 |  .irpc irqno,3456789abcdef | 
|---|
| 50 |  .weak _.irq_0\irqno | 
|---|
| 51 |  .set _.irq_0\irqno,_.irq | 
|---|
| 52 |  .dword _.irq_0\irqno | 
|---|
| 53 |  .endr | 
|---|
| 54 |  | 
|---|
| 55 |  .irpc irqhd,123456789abcdef | 
|---|
| 56 |  .irpc irqld,0123456789abcdef | 
|---|
| 57 |  .weak _.irq_\irqhd\irqld | 
|---|
| 58 |  .set _.irq_\irqhd\irqld,_.irq | 
|---|
| 59 |  .dword _.irq_\irqhd\irqld | 
|---|
| 60 |  .endr | 
|---|
| 61 |  .endr | 
|---|
| 62 |  | 
|---|
| 63 | ; No use having a separate file with default _.irq_[0-f][0-f] | 
|---|
| 64 | ; definitions; just provide a single stub with a weak definition | 
|---|
| 65 | ; and make it up to the user to provide a strong definition that | 
|---|
| 66 | ; they force to be linked in (i.e. not in a library or at least | 
|---|
| 67 | ; together with another symbol they know is linked in). | 
|---|
| 68 |  .text | 
|---|
| 69 |  | 
|---|
| 70 | _.irq: | 
|---|
| 71 | #ifdef __arch_common_v10_v32 | 
|---|
| 72 |  ; This is just to allow the multilib to compile without | 
|---|
| 73 |  ; hackery: the "common" subset doesn't recognize | 
|---|
| 74 |  ; interrupt-return insns. | 
|---|
| 75 | #elif __CRIS_arch_version >= 32 | 
|---|
| 76 |  rete | 
|---|
| 77 |  rfe | 
|---|
| 78 | #else | 
|---|
| 79 |  reti | 
|---|
| 80 |  nop | 
|---|
| 81 | #endif | 
|---|
| 82 | #endif /* __ELF__ || IN_CRT0 */ | 
|---|