source: rtems/cpukit/rtems/include/rtems/rtems/intr.h @ 780428f

4.104.114.95
Last change on this file since 780428f was 780428f, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 07/10/08 at 06:19:03

Extension of the RTEMS Interrupt Manager
(shared handler and handler with a handle).

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/**
2 *  @file rtems/rtems/intr.h
3 *
4 *  @brief Header file for the Interrupt Manager.
5 *
6 *  This include file contains all the constants and structures associated with
7 *  the Interrupt Manager.
8 */
9
10/*  COPYRIGHT (c) 1989-2008.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 *
17 *  $Id$
18 */
19
20#ifndef _RTEMS_RTEMS_INTR_H
21#define _RTEMS_RTEMS_INTR_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include <rtems/score/isr.h>
28
29/**
30 *  @defgroup ClassicINTR Classic API Interrupt
31 *
32 *  This encapsulates functionality which XXX
33 */
34/**@{*/
35
36/**
37 *  @brief Interrupt level type.
38 */
39typedef ISR_Level rtems_interrupt_level;
40
41/**
42 *  @brief Control block type used to manage the vectors.
43 */
44typedef ISR_Vector_number rtems_vector_number;
45
46/**
47 *  @brief Return type for interrupt handler.
48 */
49typedef void rtems_isr;
50
51/**
52 *  @brief Interrupt handler type.
53 *
54 *  @see rtems_interrupt_catch()
55 */
56typedef rtems_isr ( *rtems_isr_entry )(
57                 rtems_vector_number
58             );
59
60/**
61 *  @brief Initializes the Interrupt Manager.
62 */
63void _Interrupt_Manager_initialization( void );
64
65/**
66 *  @brief Implementation of the rtems_interrupt_catch directive.
67 * 
68 *  This directive installs @a new_isr_handler as the RTEMS interrupt service
69 *  routine for the interrupt vector with number @a vector.  The previous RTEMS
70 *  interrupt service routine is returned in @a old_isr_handler.
71 */
72rtems_status_code rtems_interrupt_catch(
73  rtems_isr_entry      new_isr_handler,
74  rtems_vector_number  vector,
75  rtems_isr_entry     *old_isr_handler
76);
77
78/**
79 *  @brief Disables all maskable interrupts and returns the previous level in
80 *  @a _isr_cookie.
81 * 
82 *  @note The interrupt level shall be of type @ref rtems_interrupt_level.
83 */
84#define rtems_interrupt_disable( _isr_cookie ) \
85    _ISR_Disable(_isr_cookie)
86
87/**
88 *  @brief Enables maskable interrupts to the level indicated by @a
89 *  _isr_cookie.
90 * 
91 *  @note The interrupt level shall be of type @ref rtems_interrupt_level.
92 */
93#define rtems_interrupt_enable( _isr_cookie ) \
94    _ISR_Enable(_isr_cookie)
95
96/**
97 *  @brief Temporarily enables maskable interrupts to the level in @a
98 *  _isr_cookie before redisabling them.
99 * 
100 *  @note The interrupt level shall be of type @ref rtems_interrupt_level.
101 */
102#define rtems_interrupt_flash( _isr_cookie ) \
103    _ISR_Flash(_isr_cookie)
104
105/**
106 *  @brief Returns TRUE if the processor is currently servicing an interrupt
107 *  and FALSE otherwise.
108 * 
109 *  A return value of TRUE indicates that the caller is an interrupt service
110 *  routine and @b not a thread.  The directives available to an interrupt
111 *  service routine are restricted.
112 */
113#define rtems_interrupt_is_in_progress() \
114    _ISR_Is_in_progress()
115
116/**
117 *  @brief This routine generates an interrupt.
118 * 
119 *  @note No implementation.
120 */
121#define rtems_interrupt_cause( _interrupt_to_cause )
122
123/**
124 *  @brief This routine clears the specified interrupt.
125 * 
126 *  @note No implementation.
127 */
128#define rtems_interrupt_clear( _interrupt_to_clear )
129
130#ifdef __cplusplus
131}
132#endif
133
134/**@}*/
135
136#endif
137/* end of include file */
Note: See TracBrowser for help on using the repository browser.