source: rtems/bsps/mips/jmr3904/irq/vectorisrs.c @ 8f8ccee

5
Last change on this file since 8f8ccee was 8f8ccee, checked in by Sebastian Huber <sebastian.huber@…>, on 04/23/18 at 07:50:39

bsps: Move interrupt controller support to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 *  @file
3 * 
4 *  TX3904 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 <bsp/irq.h>
19#include <rtems/bspIo.h>  /* for printk */
20#include <bsp/irq-generic.h>
21#include <libcpu/isr_entries.h>
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    bsp_interrupt_handler_dispatch( TX3904_IRQ_INT0 );
36
37  if ( cause & 0x40 ) {     /* (IP[4] == 1) ==> IP[0-3] are valid */
38    unsigned int v = (cause >> 2) & 0x0f;
39    bsp_interrupt_handler_dispatch( MIPS_INTERRUPT_BASE + v );
40  }
41
42  if ( cause & 0x02 )       /* SW[0] */
43    bsp_interrupt_handler_dispatch( TX3904_IRQ_SOFTWARE_1 );
44
45  if ( cause & 0x01 )       /* IP[1] */
46    bsp_interrupt_handler_dispatch( TX3904_IRQ_SOFTWARE_2 );
47}
Note: See TracBrowser for help on using the repository browser.