Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:02

0001 /*  set_vector
0002  *
0003  *  NOTE: This function is considered OBSOLETE and may vanish soon.
0004  *  Calls to set_vector should be replaced by calls to
0005  *  rtems_interrupt_catch or _CPU_ISR_install_raw_handler.
0006  *
0007  *  This routine installs an interrupt vector on the target Board/CPU.
0008  *  This routine is allowed to be as board dependent as necessary.
0009  *
0010  *  INPUT:
0011  *    handler - interrupt handler entry point
0012  *    vector  - vector number
0013  *    type    - 0 indicates raw hardware connect
0014  *              1 indicates RTEMS interrupt connect
0015  *
0016  *  RETURNS:
0017  *    address of previous interrupt handler
0018  *
0019  *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
0020  *           Bernd Becker (becker@faw.uni-ulm.de)
0021  *
0022  *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
0023  *
0024  *  This program is distributed in the hope that it will be useful,
0025  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0026  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0027  *
0028  *
0029  *  COPYRIGHT (c) 1998.
0030  *  On-Line Applications Research Corporation (OAR).
0031  *
0032  *  The license and distribution terms for this file may be
0033  *  found in the file LICENSE in this distribution or at
0034  *  http://www.rtems.org/license/LICENSE.
0035  */
0036 
0037 #include <rtems.h>
0038 #include <bsp.h>
0039 
0040 sh_isr_entry set_vector(            /* returns old vector */
0041   rtems_isr_entry     handler,          /* isr routine        */
0042   rtems_vector_number vector,           /* vector number      */
0043   int                 type              /* RTEMS or RAW intr  */
0044 )
0045 {
0046   sh_isr_entry previous_isr;
0047 
0048   if ( type )
0049     rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
0050   else {
0051     _CPU_ISR_install_raw_handler( vector, handler, &previous_isr );
0052   }
0053 
0054   return previous_isr;
0055 }