OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [sparc/] [erc32/] [startup/] [setvec.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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: setvec.c,v 1.2 2001-09-27 12:01:14 chris Exp $
31
 */
32
 
33
#include <bsp.h>
34
 
35
rtems_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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.