source: rtems/cpukit/rtems/src/intrcatch.c @ 54d540f

4.104.114.84.95
Last change on this file since 54d540f was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  Interrupt Manager
3 *
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15#include <rtems/system.h>
16#include <rtems/rtems/status.h>
17#include <rtems/score/isr.h>
18#include <rtems/rtems/intr.h>
19
20/*  rtems_interrupt_catch
21 *
22 *  This directive allows a thread to specify what action to take when
23 *  catching signals.
24 *
25 *  Input parameters:
26 *    new_isr_handler - address of interrupt service routine (isr)
27 *    vector          - interrupt vector number
28 *    old_isr_handler - address at which to store previous ISR address
29 *
30 *  Output parameters:
31 *    RTEMS_SUCCESSFUL - always succeeds
32 *    *old_isr_handler  - previous ISR address
33 */
34
35rtems_status_code rtems_interrupt_catch(
36  rtems_isr_entry      new_isr_handler,
37  rtems_vector_number  vector,
38  rtems_isr_entry     *old_isr_handler
39)
40{
41  if ( !_ISR_Is_vector_number_valid( vector ) )
42    return RTEMS_INVALID_NUMBER;
43
44  if ( !_ISR_Is_valid_user_handler( (void *) new_isr_handler ) )
45    return RTEMS_INVALID_ADDRESS;
46
47  if ( !_ISR_Is_valid_user_handler( (void *) old_isr_handler ) )
48    return RTEMS_INVALID_ADDRESS;
49
50  _ISR_Install_vector(
51    vector, (proc_ptr)new_isr_handler, (proc_ptr *)old_isr_handler );
52
53  return RTEMS_SUCCESSFUL;
54}
Note: See TracBrowser for help on using the repository browser.