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

4.104.114.84.95
Last change on this file since 5c27c80 was 5c27c80, checked in by Joel Sherrill <joel.sherrill@…>, on 01/12/01 at 13:38:01

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

  • r46xx/vectorisrs/vectorisrs.c (mips_get_cause): Corrected constraints from general to register.
  • tx39/vectorisrs/vectorisrs.c (mips_get_cause): Corrected constraints from general to register.
  • 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" : "=r" (_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.