source: rtems/c/src/lib/libbsp/sparc/leon/startup/setvec.c @ b21b0ab

4.104.114.84.95
Last change on this file since b21b0ab was b21b0ab, checked in by Joel Sherrill <joel.sherrill@…>, on 11/13/00 at 22:40:29

2000-11-13 Jiri Gaisler <jgais@…>

  • .cvsignore, ChangeLog?, Makefile.am, README, bsp_specs, configure.in, times, clock/.cvsignore, clock/Makefile.am, clock/ckinit.c, console/.cvsignore, console/Makefile.am, console/console.c, console/consolereserveresources.c, console/debugputs.c, gnatsupp/.cvsignore, gnatsupp/Makefile.am, gnatsupp/gnatsupp.c, include/.cvsignore, include/Makefile.am, include/bsp.h, include/coverhd.h, include/leon.h, start/.cvsignore, start/Makefile.am, startup/.cvsignore, startup/Makefile.am, startup/boardinit.S, startup/linkcmds, startup/setvec.c, startup/spurious.c, timer/.cvsignore, timer/Makefile.am, timer/timer.c, tools/.cvsignore, tools/Makefile.am, tools/configure.in, tools/runtest.in, wrapup/.cvsignore, wrapup/Makefile.am: New file.
  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[b21b0ab]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-1998.
17 *  On-Line Applications Research Corporation (OAR).
18 *  Copyright assigned to U.S. Government, 1994.
19 *
20 *  The license and distribution terms for this file may be
21 *  found in the file LICENSE in this distribution or at
22 *  http://www.OARcorp.com/rtems/license.html.
23 *
24 *  Ported to LEON implementation of the SPARC by On-Line Applications
25 *  Research Corporation (OAR) under contract to the European Space
26 *  Agency (ESA).
27 *
28 *  LEON 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 ( LEON_INT_TRAP( real_trap ) ) {
54   
55    source = LEON_TRAP_SOURCE( real_trap );
56
57    LEON_Clear_interrupt( source );
58    LEON_Unmask_interrupt( source );
59  }
60
61  return previous_isr;
62}
63
64/* LEON specific power-down function */
65
66void _CPU_Thread_Idle_body( void )
67{
68  while (1) {
69    LEON_REG.Power_Down = 0;   /* value is irrelevant */
70  }
71}
72
Note: See TracBrowser for help on using the repository browser.