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

4.104.114.84.9
Last change on this file since acdb6558 was acdb6558, checked in by Joel Sherrill <joel.sherrill@…>, on Mar 14, 2001 at 12:49:17 AM

2001-03-13 Joel Sherrill <joel@…>

  • Added mongoose-v, mongoose-v/include, and mongoose-v/vectorisrs directories.
  • mongoosev/.cvsignore, mongoosev/Makefile.am, mongoosev/README, mongoosev/duart/.cvsignore, mongoosev/duart/Makefile.am, mongoosev/duart/README.mguart, mongoosev/duart/mg5uart.c, mongoosev/duart/mg5uart.h, mongoosev/duart/mg5uart_reg.c, mongoosev/include/.cvsignore, mongoosev/include/Makefile.am, mongoosev/include/mongoose-v.h, mongoosev/vectorisrs/.cvsignore, mongoosev/vectorisrs/Makefile.am, mongoosev/vectorisrs/vectorisrs.c: New files.
  • Makefile.am, configure.in, shared/interrupts/Makefile.am, shared/interrupts/maxvectors.c: Added support for mongoosev.
  • tx39/vectorisrs/vectorisrs.c: Corrected warning.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  $Id$
3 */
4
5#include <rtems.h>
6#include <stdlib.h>
7#include <libcpu/tx3904.h>
8
9#define mips_get_cause( _cause ) \
10  do { \
11    asm volatile( "mfc0 %0, $13; nop" : "=r" (_cause) :  ); \
12  } while (0)
13
14#define CALL_ISR(_vector) \
15  do { \
16    if ( _ISR_Vector_table[_vector] ) \
17      (_ISR_Vector_table[_vector])(_vector); \
18    else \
19      mips_default_exception(_vector); \
20  } while (0)
21
22#include <bspIo.h>  /* for printk */
23
24void mips_default_exception( int vector )
25{
26  printk( "Unhandled exception %d\n", vector );
27  rtems_fatal_error_occurred(1);
28}
29
30void mips_vector_isr_handlers( void )
31{
32  unsigned int sr;
33  unsigned int cause;
34
35  mips_get_sr( sr );
36  mips_get_cause( cause );
37
38  cause &= (sr & SR_IMASK);
39  cause >>= CAUSE_IPSHIFT;
40
41  if ( cause & 0x80 )       /* IP[5] ==> INT0 */
42    CALL_ISR( TX3904_IRQ_INT0 );
43
44  if ( cause & 0x40 ) {     /* (IP[4] == 1) ==> IP[0-3] are valid */
45    unsigned int v = (cause >> 2) & 0x0f;
46    CALL_ISR( v );
47  }
48   
49  if ( cause & 0x02 )       /* SW[0] */
50    CALL_ISR( TX3904_IRQ_SOFTWARE_1 );
51
52  if ( cause & 0x01 )       /* IP[1] */
53    CALL_ISR( TX3904_IRQ_SOFTWARE_2 );
54}
Note: See TracBrowser for help on using the repository browser.