1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * TX4925 Interrupt Vectoring |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | * COPYRIGHT (c) 1989-2012. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.org/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #include <rtems.h> |
---|
17 | #include <stdlib.h> |
---|
18 | #include <libcpu/isr_entries.h> |
---|
19 | #include <libcpu/tx4938.h> |
---|
20 | #include <bsp/irq.h> |
---|
21 | #include <bsp/irq-generic.h> |
---|
22 | #include <rtems/bspIo.h> /* for printk */ |
---|
23 | |
---|
24 | void mips_default_isr( int vector ); |
---|
25 | |
---|
26 | void mips_vector_isr_handlers( CPU_Interrupt_frame *frame ) |
---|
27 | { |
---|
28 | unsigned int sr; |
---|
29 | unsigned int cause; |
---|
30 | unsigned int pending; |
---|
31 | |
---|
32 | mips_get_sr( sr ); |
---|
33 | mips_get_cause( cause ); |
---|
34 | |
---|
35 | pending = (cause & sr & 0x700) >> CAUSE_IPSHIFT; |
---|
36 | |
---|
37 | if ( pending & 0x4 ) { /* (IP[2] == 1) ==> IP[3-7] are valid */ |
---|
38 | unsigned int v = (cause >> (CAUSE_IPSHIFT + 3)) & 0x1f; |
---|
39 | bsp_interrupt_handler_dispatch( MIPS_INTERRUPT_BASE + v ); |
---|
40 | } |
---|
41 | |
---|
42 | if ( pending & 0x01 ) /* IP[0] */ |
---|
43 | bsp_interrupt_handler_dispatch( TX4938_IRQ_SOFTWARE_1 ); |
---|
44 | |
---|
45 | if ( pending & 0x02 ) /* IP[1] */ |
---|
46 | bsp_interrupt_handler_dispatch( TX4938_IRQ_SOFTWARE_2 ); |
---|
47 | } |
---|
48 | |
---|
49 | void 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 | |
---|
60 | while(1); /* Lock it up */ |
---|
61 | |
---|
62 | rtems_fatal_error_occurred(1); |
---|
63 | } |
---|
64 | |
---|