source: rtems/c/src/lib/libbsp/sparc/erc32/startup/setvec.c @ 08311cc3

4.104.114.84.95
Last change on this file since 08311cc3 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*  set_vector
2 *
3 *  This routine installs an interrupt vector on the SPARC simulator.
4 *
5 *  INPUT PARAMETERS:
6 *    handler - interrupt handler entry point
7 *    vector  - vector number
8 *    type    - 0 indicates raw hardware connect
9 *              1 indicates RTEMS interrupt connect
10 *
11 *  OUTPUT PARAMETERS:  NONE
12 *
13 *  RETURNS:
14 *    address of previous interrupt handler
15 *
16 *  COPYRIGHT (c) 1989-1999.
17 *  On-Line Applications Research Corporation (OAR).
18 *
19 *  The license and distribution terms for this file may be
20 *  found in the file LICENSE in this distribution or at
21 *  http://www.OARcorp.com/rtems/license.html.
22 *
23 *  Ported to ERC32 implementation of the SPARC by On-Line Applications
24 *  Research Corporation (OAR) under contract to the European Space
25 *  Agency (ESA).
26 *
27 *  ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
28 *  European Space Agency.
29 *
30 *  $Id$
31 */
32
33#include <bsp.h>
34
35rtems_isr_entry set_vector(                   /* returns old vector */
36  rtems_isr_entry     handler,                /* isr routine        */
37  rtems_vector_number vector,                 /* vector number      */
38  int                 type                    /* RTEMS or RAW intr  */
39)
40{
41  rtems_isr_entry previous_isr;
42  unsigned32      real_trap;
43  unsigned32      source;
44
45  if ( type )
46    rtems_interrupt_catch( handler, vector, &previous_isr );
47  else
48    _CPU_ISR_install_raw_handler( vector, handler, (void *)&previous_isr );
49
50  real_trap = SPARC_REAL_TRAP_NUMBER( vector );
51
52  if ( ERC32_Is_MEC_Trap( real_trap ) ) {
53   
54    source = ERC32_TRAP_SOURCE( real_trap );
55
56    ERC32_Clear_interrupt( source );
57    ERC32_Unmask_interrupt( source );
58  }
59
60  return previous_isr;
61}
62
Note: See TracBrowser for help on using the repository browser.