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 | |
---|
18 | #ifndef _RTEMS_RTEMS_INTR_H |
---|
19 | #define _RTEMS_RTEMS_INTR_H |
---|
20 | |
---|
21 | #ifdef __cplusplus |
---|
22 | extern "C" { |
---|
23 | #endif |
---|
24 | |
---|
25 | #include <rtems/score/isr.h> |
---|
26 | |
---|
27 | /** |
---|
28 | * @defgroup ClassicINTR Interrupts |
---|
29 | * |
---|
30 | * @ingroup ClassicRTEMS |
---|
31 | * |
---|
32 | * This encapsulates functionality which XXX |
---|
33 | */ |
---|
34 | /**@{*/ |
---|
35 | |
---|
36 | /** |
---|
37 | * @brief Interrupt level type. |
---|
38 | */ |
---|
39 | typedef ISR_Level rtems_interrupt_level; |
---|
40 | |
---|
41 | /** |
---|
42 | * @brief Control block type used to manage the vectors. |
---|
43 | */ |
---|
44 | typedef ISR_Vector_number rtems_vector_number; |
---|
45 | |
---|
46 | /** |
---|
47 | * @brief Return type for interrupt handler. |
---|
48 | */ |
---|
49 | typedef ISR_Handler rtems_isr; |
---|
50 | |
---|
51 | #if (CPU_SIMPLE_VECTORED_INTERRUPTS == FALSE) |
---|
52 | |
---|
53 | typedef ISR_Handler_entry rtems_isr_entry; |
---|
54 | |
---|
55 | #else |
---|
56 | /** |
---|
57 | * @brief Interrupt handler type. |
---|
58 | * |
---|
59 | * @see rtems_interrupt_catch() |
---|
60 | */ |
---|
61 | typedef rtems_isr ( *rtems_isr_entry )( |
---|
62 | rtems_vector_number |
---|
63 | ); |
---|
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 | */ |
---|
72 | rtems_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 | #endif |
---|
78 | |
---|
79 | /** |
---|
80 | * @brief Disables all maskable interrupts and returns the previous level in |
---|
81 | * @a _isr_cookie. |
---|
82 | * |
---|
83 | * @note The interrupt level shall be of type @ref rtems_interrupt_level. |
---|
84 | */ |
---|
85 | #define rtems_interrupt_disable( _isr_cookie ) \ |
---|
86 | _ISR_Disable(_isr_cookie) |
---|
87 | |
---|
88 | /** |
---|
89 | * @brief Enables maskable interrupts to the level indicated by @a |
---|
90 | * _isr_cookie. |
---|
91 | * |
---|
92 | * @note The interrupt level shall be of type @ref rtems_interrupt_level. |
---|
93 | */ |
---|
94 | #define rtems_interrupt_enable( _isr_cookie ) \ |
---|
95 | _ISR_Enable(_isr_cookie) |
---|
96 | |
---|
97 | /** |
---|
98 | * @brief Temporarily enables maskable interrupts to the level in @a |
---|
99 | * _isr_cookie before redisabling them. |
---|
100 | * |
---|
101 | * @note The interrupt level shall be of type @ref rtems_interrupt_level. |
---|
102 | */ |
---|
103 | #define rtems_interrupt_flash( _isr_cookie ) \ |
---|
104 | _ISR_Flash(_isr_cookie) |
---|
105 | |
---|
106 | /** |
---|
107 | * @brief Returns true if the processor is currently servicing an interrupt |
---|
108 | * and false otherwise. |
---|
109 | * |
---|
110 | * A return value of true indicates that the caller is an interrupt service |
---|
111 | * routine and @b not a thread. The directives available to an interrupt |
---|
112 | * service routine are restricted. |
---|
113 | */ |
---|
114 | #define rtems_interrupt_is_in_progress() \ |
---|
115 | _ISR_Is_in_progress() |
---|
116 | |
---|
117 | /** |
---|
118 | * @brief This routine generates an interrupt. |
---|
119 | * |
---|
120 | * @note No implementation. |
---|
121 | */ |
---|
122 | #define rtems_interrupt_cause( _interrupt_to_cause ) |
---|
123 | |
---|
124 | /** |
---|
125 | * @brief This routine clears the specified interrupt. |
---|
126 | * |
---|
127 | * @note No implementation. |
---|
128 | */ |
---|
129 | #define rtems_interrupt_clear( _interrupt_to_clear ) |
---|
130 | |
---|
131 | #ifdef __cplusplus |
---|
132 | } |
---|
133 | #endif |
---|
134 | |
---|
135 | /**@}*/ |
---|
136 | |
---|
137 | #endif |
---|
138 | /* end of include file */ |
---|