1 | /** |
---|
2 | * @file rtems/rtems/intr.h |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * This include file contains all the constants and structures associated |
---|
7 | * with the Interrupt Manager. |
---|
8 | * |
---|
9 | * COPYRIGHT (c) 1989-1999. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.com/license/LICENSE. |
---|
15 | * |
---|
16 | * $Id$ |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef _RTEMS_RTEMS_INTR_H |
---|
20 | #define _RTEMS_RTEMS_INTR_H |
---|
21 | |
---|
22 | #ifdef __cplusplus |
---|
23 | extern "C" { |
---|
24 | #endif |
---|
25 | |
---|
26 | #include <rtems/score/isr.h> |
---|
27 | |
---|
28 | /* |
---|
29 | * Interrupt level type |
---|
30 | */ |
---|
31 | |
---|
32 | typedef ISR_Level rtems_interrupt_level; |
---|
33 | |
---|
34 | /* |
---|
35 | * The following type defines the control block used to manage |
---|
36 | * the vectors. |
---|
37 | */ |
---|
38 | |
---|
39 | typedef ISR_Vector_number rtems_vector_number; |
---|
40 | |
---|
41 | /* |
---|
42 | * Return type for ISR Handler |
---|
43 | */ |
---|
44 | |
---|
45 | typedef void rtems_isr; |
---|
46 | |
---|
47 | /* |
---|
48 | * Pointer to an ISR Handler |
---|
49 | */ |
---|
50 | |
---|
51 | typedef rtems_isr ( *rtems_isr_entry )( |
---|
52 | rtems_vector_number |
---|
53 | ); |
---|
54 | |
---|
55 | /* |
---|
56 | * _Interrupt_Manager_initialization |
---|
57 | * |
---|
58 | * DESCRIPTION: |
---|
59 | * |
---|
60 | * This routine initializes the interrupt manager. |
---|
61 | * |
---|
62 | */ |
---|
63 | |
---|
64 | void _Interrupt_Manager_initialization( void ); |
---|
65 | |
---|
66 | /* |
---|
67 | * rtems_interrupt_catch |
---|
68 | * |
---|
69 | * DESCRIPTION: |
---|
70 | * |
---|
71 | * This routine implements the rtems_interrupt_catch directive. This |
---|
72 | * directive installs new_isr_handler as the RTEMS interrupt service |
---|
73 | * routine for vector. The previous RTEMS interrupt service |
---|
74 | * routine is returned in old_isr_handler. |
---|
75 | */ |
---|
76 | |
---|
77 | rtems_status_code rtems_interrupt_catch( |
---|
78 | rtems_isr_entry new_isr_handler, |
---|
79 | rtems_vector_number vector, |
---|
80 | rtems_isr_entry *old_isr_handler |
---|
81 | ); |
---|
82 | |
---|
83 | /* |
---|
84 | * rtems_interrupt_disable |
---|
85 | * |
---|
86 | * DESCRIPTION: |
---|
87 | * |
---|
88 | * This routine disables all maskable interrupts and returns the |
---|
89 | * previous level in _isr_cookie. |
---|
90 | */ |
---|
91 | |
---|
92 | #define rtems_interrupt_disable( _isr_cookie ) \ |
---|
93 | _ISR_Disable(_isr_cookie) |
---|
94 | |
---|
95 | /* |
---|
96 | * rtems_interrupt_enable |
---|
97 | * |
---|
98 | * DESCRIPTION: |
---|
99 | * |
---|
100 | * This routine enables maskable interrupts to the level indicated |
---|
101 | * _isr_cookie. |
---|
102 | */ |
---|
103 | |
---|
104 | #define rtems_interrupt_enable( _isr_cookie ) \ |
---|
105 | _ISR_Enable(_isr_cookie) |
---|
106 | |
---|
107 | /* |
---|
108 | * rtems_interrupt_flash |
---|
109 | * |
---|
110 | * DESCRIPTION: |
---|
111 | * |
---|
112 | * This routine temporarily enables maskable interrupts to the |
---|
113 | * level in _isr_cookie before redisabling them. |
---|
114 | */ |
---|
115 | |
---|
116 | #define rtems_interrupt_flash( _isr_cookie ) \ |
---|
117 | _ISR_Flash(_isr_cookie) |
---|
118 | |
---|
119 | /* |
---|
120 | * rtems_interrupt_is_in_progress |
---|
121 | * |
---|
122 | * DESCRIPTION: |
---|
123 | * |
---|
124 | * This function returns TRUE if the processor is currently servicing |
---|
125 | * an interrupt and FALSE otherwise. A return value of TRUE indicates |
---|
126 | * that the caller is an interrupt service routine, NOT a thread. The |
---|
127 | * directives available to an interrupt service routine are restricted. |
---|
128 | */ |
---|
129 | |
---|
130 | #define rtems_interrupt_is_in_progress() \ |
---|
131 | _ISR_Is_in_progress() |
---|
132 | |
---|
133 | /* |
---|
134 | * rtems_interrupt_cause |
---|
135 | * |
---|
136 | * DESCRIPTION: |
---|
137 | * |
---|
138 | * This routine generates an interrupt. |
---|
139 | * |
---|
140 | * NOTE: No implementation. |
---|
141 | */ |
---|
142 | |
---|
143 | #define rtems_interrupt_cause( _interrupt_to_cause ) |
---|
144 | |
---|
145 | /* |
---|
146 | * rtems_interrupt_cause |
---|
147 | * |
---|
148 | * DESCRIPTION: |
---|
149 | * |
---|
150 | * This routine clears the specified interrupt. |
---|
151 | * |
---|
152 | * NOTE: No implementation. |
---|
153 | */ |
---|
154 | |
---|
155 | #define rtems_interrupt_clear( _interrupt_to_clear ) |
---|
156 | |
---|
157 | #ifdef __cplusplus |
---|
158 | } |
---|
159 | #endif |
---|
160 | |
---|
161 | #endif |
---|
162 | /* end of include file */ |
---|