[ac7d5ef0] | 1 | /* |
---|
| 2 | * Interrupt Manager |
---|
| 3 | * |
---|
| 4 | * |
---|
[60b791ad] | 5 | * COPYRIGHT (c) 1989-1998. |
---|
[ac7d5ef0] | 6 | * On-Line Applications Research Corporation (OAR). |
---|
[03f2154e] | 7 | * Copyright assigned to U.S. Government, 1994. |
---|
[ac7d5ef0] | 8 | * |
---|
[98e4ebf5] | 9 | * The license and distribution terms for this file may be |
---|
| 10 | * found in the file LICENSE in this distribution or at |
---|
[03f2154e] | 11 | * http://www.OARcorp.com/rtems/license.html. |
---|
[ac7d5ef0] | 12 | * |
---|
| 13 | * $Id$ |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | #include <rtems/system.h> |
---|
[3a4ae6c] | 17 | #include <rtems/rtems/status.h> |
---|
[5e9b32b] | 18 | #include <rtems/score/isr.h> |
---|
[3a4ae6c] | 19 | #include <rtems/rtems/intr.h> |
---|
[ac7d5ef0] | 20 | |
---|
| 21 | /* _Interrupt_Manager_initialization |
---|
| 22 | * |
---|
| 23 | * This routine initializes the interrupt manager. |
---|
| 24 | * |
---|
| 25 | * Input parameters: NONE |
---|
| 26 | * |
---|
| 27 | * Output parameters: NONE |
---|
| 28 | */ |
---|
| 29 | |
---|
| 30 | void _Interrupt_Manager_initialization( void ) |
---|
| 31 | { |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | /* rtems_interrupt_catch |
---|
| 35 | * |
---|
| 36 | * This directive allows a thread to specify what action to take when |
---|
| 37 | * catching signals. |
---|
| 38 | * |
---|
| 39 | * Input parameters: |
---|
| 40 | * new_isr_handler - address of interrupt service routine (isr) |
---|
| 41 | * vector - interrupt vector number |
---|
| 42 | * old_isr_handler - address at which to store previous ISR address |
---|
| 43 | * |
---|
| 44 | * Output parameters: |
---|
| 45 | * RTEMS_SUCCESSFUL - always succeeds |
---|
| 46 | * *old_isr_handler - previous ISR address |
---|
| 47 | */ |
---|
| 48 | |
---|
| 49 | rtems_status_code rtems_interrupt_catch( |
---|
| 50 | rtems_isr_entry new_isr_handler, |
---|
| 51 | rtems_vector_number vector, |
---|
| 52 | rtems_isr_entry *old_isr_handler |
---|
| 53 | ) |
---|
| 54 | { |
---|
| 55 | if ( !_ISR_Is_vector_number_valid( vector ) ) |
---|
[3a4ae6c] | 56 | return RTEMS_INVALID_NUMBER; |
---|
[ac7d5ef0] | 57 | |
---|
[ffe316d] | 58 | if ( !_ISR_Is_valid_user_handler( (void *) new_isr_handler ) ) |
---|
[3a4ae6c] | 59 | return RTEMS_INVALID_ADDRESS; |
---|
[ac7d5ef0] | 60 | |
---|
[cdfd74a5] | 61 | if ( !_ISR_Is_valid_user_handler( (void *) old_isr_handler ) ) |
---|
| 62 | return RTEMS_INVALID_ADDRESS; |
---|
| 63 | |
---|
[ac7d5ef0] | 64 | _ISR_Install_vector( |
---|
| 65 | vector, (proc_ptr)new_isr_handler, (proc_ptr *)old_isr_handler ); |
---|
| 66 | |
---|
[3a4ae6c] | 67 | return RTEMS_SUCCESSFUL; |
---|
[ac7d5ef0] | 68 | } |
---|