OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [rtems/] [src/] [intrcatch.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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: intrcatch.c,v 1.2 2001-09-27 11:59:19 chris Exp $
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
 
35
rtems_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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.