source: rtems/c/src/lib/libbsp/sparc64/shared/startup/setvec.c @ 71d97c9

4.115
Last change on this file since 71d97c9 was 71d97c9, checked in by Gedare Bloom <gedare@…>, on Dec 8, 2014 at 6:16:37 PM

sparc64: put each copyright on one line

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*  set_vector
2 *
3 *  This routine installs an interrupt vector on the sun4v niagara
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. On-Line Applications Research Corporation (OAR).
17 *
18 *  The license and distribution terms for this file may be
19 *  found in the file LICENSE in this distribution or at
20 *  http://www.rtems.org/license/LICENSE.
21 */
22
23#include <bsp.h>
24
25rtems_isr_entry set_vector(                   /* returns old vector */
26  rtems_isr_entry     handler,                /* isr routine        */
27  rtems_vector_number vector,                 /* vector number      */
28  int                 type                    /* RTEMS or RAW intr  */
29)
30{
31  rtems_isr_entry previous_isr;
32  uint32_t      real_trap;
33  uint32_t      source;
34  int bit_mask;
35
36  if ( type )
37    rtems_interrupt_catch( handler, vector, &previous_isr );
38  else 
39    _CPU_ISR_install_raw_handler( vector, handler, (void *)&previous_isr );
40
41  real_trap = SPARC_REAL_TRAP_NUMBER( vector );
42
43  /* check if this is an interrupt, if so, clear and unmask interrupts for
44   * this level
45   */
46  /* Interrupts have real_trap numbers between 0x41 and 0x4F (levels 1 - 15) */
47  if (real_trap >= 0x41 && real_trap <= 0x4F) {
48    source = real_trap - 0x40;
49    bit_mask = 1<<source;
50
51    sparc64_clear_interrupt_bits(bit_mask);
52  }
53
54
55  return previous_isr;
56}
Note: See TracBrowser for help on using the repository browser.