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

4.104.114.84.95
Last change on this file since cb585c3 was cb585c3, checked in by Joel Sherrill <joel.sherrill@…>, on 01/29/97 at 00:32:23

erc32 bsp supercedes sis

  • Property mode set to 100644
File size: 1.8 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, 1990, 1991, 1992, 1993, 1994.
17 *  On-Line Applications Research Corporation (OAR).
18 *  All rights assigned to U.S. Government, 1994.
19 *
20 *  This material may be reproduced by or for the U.S. Government pursuant
21 *  to the copyright license under the clause at DFARS 252.227-7013.  This
22 *  notice must appear in all copies of this file and its derivatives.
23 *
24 *  Ported to ERC32 implementation of the SPARC by On-Line Applications
25 *  Research Corporation (OAR) under contract to the European Space
26 *  Agency (ESA).
27 *
28 *  ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
29 *  European Space Agency.
30 *
31 *  $Id$
32 */
33
34#include <bsp.h>
35
36rtems_isr_entry set_vector(                   /* returns old vector */
37  rtems_isr_entry     handler,                /* isr routine        */
38  rtems_vector_number vector,                 /* vector number      */
39  int                 type                    /* RTEMS or RAW intr  */
40)
41{
42  rtems_isr_entry previous_isr;
43  unsigned32      real_trap;
44  unsigned32      source;
45
46  if ( type )
47    rtems_interrupt_catch( handler, vector, &previous_isr );
48  else
49    _CPU_ISR_install_raw_handler( vector, handler, (void *)&previous_isr );
50
51  real_trap = SPARC_REAL_TRAP_NUMBER( vector );
52
53  if ( ERC32_Is_MEC_Trap( real_trap ) ) {
54   
55    source = ERC32_TRAP_SOURCE( real_trap );
56
57    ERC32_Clear_interrupt( source );
58    ERC32_Unmask_interrupt( source );
59  }
60
61  return previous_isr;
62}
63
Note: See TracBrowser for help on using the repository browser.