source: rtems/c/src/lib/libbsp/unix/posix/startup/setvec.c @ 637df35

4.104.114.84.95
Last change on this file since 637df35 was 637df35, checked in by Joel Sherrill <joel.sherrill@…>, on Jul 12, 1995 at 7:47:25 PM

Ada95, gnat, go32

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*  set_vector
2 *
3 *  This routine installs an interrupt vector on UNIX.
4 *
5 *  INPUT:
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 *  NOTE 'type' is ignored on hppa; all interrupts are owned by RTEMS
12 *
13 *  RETURNS:
14 *    address of previous interrupt handler
15 *
16 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
17 *  On-Line Applications Research Corporation (OAR).
18 *  All rights assigned to U.S. Government, 1994.
19 *
20 *  This material may be reproduced by or for the U.S. Government pursuant
21 *  to the copyright license under the clause at DFARS 252.227-7013.  This
22 *  notice must appear in all copies of this file and its derivatives.
23 *
24 *  $Id$
25 */
26
27#include <rtems.h>
28#include <bsp.h>
29
30/*
31 * Install an interrupt handler in the right place
32 * given its vector number from cpu/hppa.h
33 * There are 2 places an interrupt can be installed
34 *      _ISR_Vector_table
35 *      bsp interrupt      XXX: nyi
36 *
37 * We decide which based on the vector number
38 */
39
40unix_isr_entry
41set_vector(                                     /* returns old vector */
42    rtems_isr_entry     handler,                /* isr routine        */
43    rtems_vector_number vector,                 /* vector number      */
44    int                 type                    /* RTEMS or RAW intr  */
45)
46{
47    rtems_isr_entry  rtems_isr_ptr;
48    proc_ptr         raw_isr_ptr;
49
50    if ( type ) {
51      rtems_interrupt_catch( handler, vector, &rtems_isr_ptr );
52      return (unix_isr_entry) rtems_isr_ptr;
53    } else {
54      _CPU_ISR_install_vector( vector, (proc_ptr) handler, &raw_isr_ptr );
55      return (unix_isr_entry) raw_isr_ptr;
56    }
57   
58}
59
60
Note: See TracBrowser for help on using the repository browser.