source: rtems/c/src/lib/libcpu/mips/r46xx/vectorisrs/vectorisrs.c @ b03f4f2

4.104.114.84.95
Last change on this file since b03f4f2 was b03f4f2, checked in by Joel Sherrill <joel.sherrill@…>, on 01/08/01 at 18:11:35

2001-01-08 Joel Sherrill <joel@…>

  • Added r46xx directory.
  • Makefile.am, configure.in: Modified to reflect addition of r46xx.
  • shared/interrupts/installisrentries.c: Fixed typo.
  • r46xx/.cvsignore, r46xx/Makefile.am, r46xx/vectorisrs/.cvsignore, r46xx/vectorisrs/Makefile.am, r46xx/vectorisrs/vectorisrs.c: New files.
  • Property mode set to 100644
File size: 874 bytes
Line 
1/*
2 *  $Id$
3 */
4
5#include <rtems.h>
6#include <stdlib.h>
7
8#define mips_get_cause( _cause ) \
9  do { \
10    asm volatile( "mfc0 %0, $13; nop" : "=g" (_cause) :  ); \
11  } while (0)
12
13#define CALL_ISR(_vector) \
14  do { \
15    if ( _ISR_Vector_table[_vector] ) \
16      (_ISR_Vector_table[_vector])(_vector); \
17    else \
18      mips_default_exception(_vector); \
19  } while (0)
20
21void mips_default_exception( int vector )
22{
23  printk( "Unhandled exception %d\n", vector );
24  rtems_fatal_error_occurred(1);
25}
26
27void mips_vector_isr_handlers( void )
28{
29  unsigned int sr;
30  unsigned int cause;
31  unsigned int i;
32  unsigned int mask;
33
34  mips_get_sr( sr );
35  mips_get_cause( cause );
36
37  cause &= (sr & SR_IMASK);
38  cause >>= CAUSE_IPSHIFT;
39
40  /* XXX check this and think about it. */
41
42  for ( i=1, mask=0x80 ; i<=8 ; i++, mask >>= 1 ) {
43    if ( cause & mask )
44      CALL_ISR( 8 - i );
45  }
46}
Note: See TracBrowser for help on using the repository browser.