source: rtems/c/src/lib/libcpu/mips/tx39/vectorisrs/vectorisrs.c @ 73b5bd5d

4.104.114.84.95
Last change on this file since 73b5bd5d was 73b5bd5d, checked in by Ralf Corsepius <ralf.corsepius@…>, on Apr 15, 2004 at 1:33:58 PM

Remove stray white spaces.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  TX3904 Interrupt Vectoring
3 *
4 *  $Id$
5 */
6
7#include <rtems.h>
8#include <stdlib.h>
9#include <libcpu/tx3904.h>
10
11void mips_default_isr( int vector );
12
13#define CALL_ISR(_vector,_frame) \
14  do { \
15    if ( _ISR_Vector_table[_vector] ) \
16      (_ISR_Vector_table[_vector])(_vector,_frame); \
17    else \
18      mips_default_isr(_vector); \
19  } while (0)
20
21#include <rtems/bspIo.h>  /* for printk */
22
23void mips_vector_isr_handlers( CPU_Interrupt_frame *frame )
24{
25  unsigned int sr;
26  unsigned int cause;
27
28  mips_get_sr( sr );
29  mips_get_cause( cause );
30
31  cause &= (sr & SR_IMASK);
32  cause >>= CAUSE_IPSHIFT;
33
34  if ( cause & 0x80 )       /* IP[5] ==> INT0 */
35    CALL_ISR( TX3904_IRQ_INT0, frame );
36
37  if ( cause & 0x40 ) {     /* (IP[4] == 1) ==> IP[0-3] are valid */
38    unsigned int v = (cause >> 2) & 0x0f;
39    CALL_ISR( MIPS_INTERRUPT_BASE + v, frame );
40  }
41   
42  if ( cause & 0x02 )       /* SW[0] */
43    CALL_ISR( TX3904_IRQ_SOFTWARE_1, frame );
44
45  if ( cause & 0x01 )       /* IP[1] */
46    CALL_ISR( TX3904_IRQ_SOFTWARE_2, frame );
47}
48
49void mips_default_isr( int vector )
50{
51  unsigned int sr;
52  unsigned int cause;
53
54  mips_get_sr( sr );
55  mips_get_cause( cause );
56
57  printk( "Unhandled isr exception: vector 0x%02x, cause 0x%08X, sr 0x%08X\n",
58      vector, cause, sr );
59  rtems_fatal_error_occurred(1);
60}
Note: See TracBrowser for help on using the repository browser.