RTEMS
setvec.c
Go to the documentation of this file.
1 
7 /* This routine installs an interrupt vector on the SPARC simulator.
8  *
9  * INPUT PARAMETERS:
10  * handler - interrupt handler entry point
11  * vector - vector number
12  * type - 0 indicates raw hardware connect
13  * 1 indicates RTEMS interrupt connect
14  *
15  * OUTPUT PARAMETERS: NONE
16  *
17  * RETURNS:
18  * address of previous interrupt handler
19  */
20 
21 /* COPYRIGHT (c) 1989-1998.
22  * On-Line Applications Research Corporation (OAR).
23  *
24  * The license and distribution terms for this file may be
25  * found in the file LICENSE in this distribution or at
26  * http://www.rtems.org/license/LICENSE.
27  *
28  * Ported to LEON implementation of the SPARC by On-Line Applications
29  * Research Corporation (OAR) under contract to the European Space
30  * Agency (ESA).
31  *
32  * LEON modifications of respective RTEMS file: COPYRIGHT (c) 1995.
33  * European Space Agency.
34  */
35 
36 #include <bsp.h>
37 
38 rtems_isr_entry set_vector( /* returns old vector */
39  rtems_isr_entry handler, /* isr routine */
40  rtems_vector_number vector, /* vector number */
41  int type /* RTEMS or RAW intr */
42 )
43 {
44  rtems_isr_entry previous_isr;
45  uint32_t real_trap;
46  uint32_t source;
47 
48  if ( type )
49  rtems_interrupt_catch( handler, vector, &previous_isr );
50  else
51  _CPU_ISR_install_raw_handler( vector, handler, (void *)&previous_isr );
52 
53  real_trap = SPARC_REAL_TRAP_NUMBER( vector );
54 
55  if ( LEON_INT_TRAP( real_trap ) ) {
56 
57  source = LEON_TRAP_SOURCE( real_trap );
58 
59  LEON_Clear_interrupt( source );
60  LEON_Unmask_interrupt( source );
61  }
62 
63  return previous_isr;
64 }
#define SPARC_REAL_TRAP_NUMBER(_trap)
Definition: cpu.h:713
rtems_status_code rtems_interrupt_catch(rtems_isr_entry new_isr_handler, rtems_vector_number vector, rtems_isr_entry *old_isr_handler)
%
void _CPU_ISR_install_raw_handler(uint32_t vector, CPU_ISR_raw_handler new_handler, CPU_ISR_raw_handler *old_handler)
SPARC specific raw ISR installer.
Definition: cpu.c:237
void(* rtems_isr_entry)(void *)
Interrupt service routines installed by rtems_interrupt_catch() shall have this function pointer type...
Definition: intr.h:103
ISR_Vector_number rtems_vector_number
%
Definition: intr.h:90