[f8b27df9] | 1 | /* set_vector |
---|
[21bfd93] | 2 | * |
---|
| 3 | * NOTE: This function is considered OBSOLETE and may vanish soon. |
---|
[0fdc099] | 4 | * Calls to set_vector should be replaced by calls to |
---|
[21bfd93] | 5 | * rtems_interrupt_catch or _CPU_ISR_install_raw_handler. |
---|
[f8b27df9] | 6 | * |
---|
| 7 | * This routine installs an interrupt vector on the target Board/CPU. |
---|
| 8 | * This routine is allowed to be as board dependent as necessary. |
---|
| 9 | * |
---|
| 10 | * INPUT: |
---|
| 11 | * handler - interrupt handler entry point |
---|
| 12 | * vector - vector number |
---|
| 13 | * type - 0 indicates raw hardware connect |
---|
| 14 | * 1 indicates RTEMS interrupt connect |
---|
| 15 | * |
---|
| 16 | * RETURNS: |
---|
| 17 | * address of previous interrupt handler |
---|
| 18 | * |
---|
| 19 | * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and |
---|
| 20 | * Bernd Becker (becker@faw.uni-ulm.de) |
---|
| 21 | * |
---|
| 22 | * COPYRIGHT (c) 1997-1998, FAW Ulm, Germany |
---|
| 23 | * |
---|
| 24 | * This program is distributed in the hope that it will be useful, |
---|
| 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
---|
| 27 | * |
---|
| 28 | * |
---|
| 29 | * COPYRIGHT (c) 1998. |
---|
| 30 | * On-Line Applications Research Corporation (OAR). |
---|
| 31 | * |
---|
| 32 | * The license and distribution terms for this file may be |
---|
| 33 | * found in the file LICENSE in this distribution or at |
---|
[0bc91860] | 34 | * http://www.rtems.com/license/LICENSE. |
---|
[f8b27df9] | 35 | * |
---|
| 36 | * $Id$ |
---|
| 37 | */ |
---|
| 38 | |
---|
| 39 | #include <rtems.h> |
---|
| 40 | #include <bsp.h> |
---|
| 41 | |
---|
| 42 | sh_isr_entry set_vector( /* returns old vector */ |
---|
| 43 | rtems_isr_entry handler, /* isr routine */ |
---|
| 44 | rtems_vector_number vector, /* vector number */ |
---|
| 45 | int type /* RTEMS or RAW intr */ |
---|
| 46 | ) |
---|
| 47 | { |
---|
| 48 | sh_isr_entry previous_isr; |
---|
| 49 | |
---|
| 50 | if ( type ) |
---|
| 51 | rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr ); |
---|
| 52 | else { |
---|
| 53 | _CPU_ISR_install_raw_handler( vector, handler, (proc_ptr*) &previous_isr ); |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | return previous_isr; |
---|
| 57 | } |
---|