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

4.104.114.84.95
Last change on this file since 1be1e913 was 1be1e913, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/31/04 at 05:17:45

2004-03-31 Ralf Corsepius <ralf_corsepius@…>

  • clock/ckinit.c, console/console.c, console/debugputs.c, erc32sonic/erc32sonic.c, include/bsp.h, include/erc32.h, startup/setvec.c, startup/spurious.c, timer/timer.c: Convert to using c99 fixed size types.
  • 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-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.rtems.com/license/LICENSE.
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  uint32_t        real_trap;
43  uint32_t        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
63/* ERC32 power-down function */
64
65void _CPU_Thread_Idle_body( void )
66{
67  while (1) {
68    ERC32_MEC.Power_Down = 0;   /* value is irrelevant */
69  }
70}
71
Note: See TracBrowser for help on using the repository browser.