1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-2008. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | |
---|
6 | @chapter Interrupt Manager |
---|
7 | |
---|
8 | @section Introduction |
---|
9 | |
---|
10 | Any real-time executive must provide a mechanism for |
---|
11 | quick response to externally generated interrupts to satisfy the |
---|
12 | critical time constraints of the application. The interrupt |
---|
13 | manager provides this mechanism for RTEMS. This manager permits |
---|
14 | quick interrupt response times by providing the critical ability |
---|
15 | to alter task execution which allows a task to be preempted upon |
---|
16 | exit from an ISR. The interrupt manager includes the following |
---|
17 | directive: |
---|
18 | |
---|
19 | @itemize @bullet |
---|
20 | @item @code{@value{DIRPREFIX}interrupt_catch} - Establish an ISR |
---|
21 | @item @code{@value{DIRPREFIX}interrupt_disable} - Disable Interrupts |
---|
22 | @item @code{@value{DIRPREFIX}interrupt_enable} - Enable Interrupts |
---|
23 | @item @code{@value{DIRPREFIX}interrupt_flash} - Flash Interrupt |
---|
24 | @item @code{@value{DIRPREFIX}interrupt_local_disable} - Disable Interrupts on Current Processor |
---|
25 | @item @code{@value{DIRPREFIX}interrupt_local_enable} - Enable Interrupts on Current Processor |
---|
26 | @item @code{@value{DIRPREFIX}interrupt_lock_initialize} - Initialize an ISR Lock |
---|
27 | @item @code{@value{DIRPREFIX}interrupt_lock_acquire} - Acquire an ISR Lock |
---|
28 | @item @code{@value{DIRPREFIX}interrupt_lock_release} - Release an ISR Lock |
---|
29 | @item @code{@value{DIRPREFIX}interrupt_lock_acquire_isr} - Acquire an ISR Lock from ISR |
---|
30 | @item @code{@value{DIRPREFIX}interrupt_lock_release_isr} - Release an ISR Lock from ISR |
---|
31 | @item @code{@value{DIRPREFIX}interrupt_is_in_progress} - Is an ISR in Progress |
---|
32 | @end itemize |
---|
33 | |
---|
34 | @section Background |
---|
35 | |
---|
36 | @subsection Processing an Interrupt |
---|
37 | |
---|
38 | @cindex interrupt processing |
---|
39 | |
---|
40 | The interrupt manager allows the application to |
---|
41 | connect a function to a hardware interrupt vector. When an |
---|
42 | interrupt occurs, the processor will automatically vector to |
---|
43 | RTEMS. RTEMS saves and restores all registers which are not |
---|
44 | preserved by the normal @value{LANGUAGE} calling convention |
---|
45 | for the target |
---|
46 | processor and invokes the user's ISR. The user's ISR is |
---|
47 | responsible for processing the interrupt, clearing the interrupt |
---|
48 | if necessary, and device specific manipulation. |
---|
49 | |
---|
50 | @findex rtems_vector_number |
---|
51 | |
---|
52 | The @code{@value{DIRPREFIX}interrupt_catch} |
---|
53 | directive connects a procedure to |
---|
54 | an interrupt vector. The vector number is managed using |
---|
55 | the @code{@value{DIRPREFIX}vector_number} data type. |
---|
56 | |
---|
57 | The interrupt service routine is assumed |
---|
58 | to abide by these conventions and have a prototype similar to |
---|
59 | the following: |
---|
60 | |
---|
61 | @ifset is-C |
---|
62 | @findex rtems_isr |
---|
63 | |
---|
64 | @example |
---|
65 | rtems_isr user_isr( |
---|
66 | rtems_vector_number vector |
---|
67 | ); |
---|
68 | @end example |
---|
69 | @end ifset |
---|
70 | |
---|
71 | @ifset is-Ada |
---|
72 | @example |
---|
73 | NOT SUPPORTED FROM Ada BINDING |
---|
74 | @end example |
---|
75 | @end ifset |
---|
76 | |
---|
77 | The vector number argument is provided by RTEMS to |
---|
78 | allow the application to identify the interrupt source. This |
---|
79 | could be used to allow a single routine to service interrupts |
---|
80 | from multiple instances of the same device. For example, a |
---|
81 | single routine could service interrupts from multiple serial |
---|
82 | ports and use the vector number to identify which port requires |
---|
83 | servicing. |
---|
84 | |
---|
85 | To minimize the masking of lower or equal priority |
---|
86 | level interrupts, the ISR should perform the minimum actions |
---|
87 | required to service the interrupt. Other non-essential actions |
---|
88 | should be handled by application tasks. Once the user's ISR has |
---|
89 | completed, it returns control to the RTEMS interrupt manager |
---|
90 | which will perform task dispatching and restore the registers |
---|
91 | saved before the ISR was invoked. |
---|
92 | |
---|
93 | The RTEMS interrupt manager guarantees that proper |
---|
94 | task scheduling and dispatching are performed at the conclusion |
---|
95 | of an ISR. A system call made by the ISR may have readied a |
---|
96 | task of higher priority than the interrupted task. Therefore, |
---|
97 | when the ISR completes, the postponed dispatch processing must |
---|
98 | be performed. No dispatch processing is performed as part of |
---|
99 | directives which have been invoked by an ISR. |
---|
100 | |
---|
101 | Applications must adhere to the following rule if |
---|
102 | proper task scheduling and dispatching is to be performed: |
---|
103 | |
---|
104 | @itemize @b{ } |
---|
105 | |
---|
106 | @item @b{The interrupt manager must be used for all ISRs which |
---|
107 | may be interrupted by the highest priority ISR which invokes an |
---|
108 | RTEMS directive.} |
---|
109 | |
---|
110 | @end itemize |
---|
111 | |
---|
112 | Consider a processor which allows a numerically low |
---|
113 | interrupt level to interrupt a numerically greater interrupt |
---|
114 | level. In this example, if an RTEMS directive is used in a |
---|
115 | level 4 ISR, then all ISRs which execute at levels 0 through 4 |
---|
116 | must use the interrupt manager. |
---|
117 | |
---|
118 | Interrupts are nested whenever an interrupt occurs |
---|
119 | during the execution of another ISR. RTEMS supports efficient |
---|
120 | interrupt nesting by allowing the nested ISRs to terminate |
---|
121 | without performing any dispatch processing. Only when the |
---|
122 | outermost ISR terminates will the postponed dispatching occur. |
---|
123 | |
---|
124 | @subsection RTEMS Interrupt Levels |
---|
125 | |
---|
126 | @cindex interrupt levels |
---|
127 | |
---|
128 | Many processors support multiple interrupt levels or |
---|
129 | priorities. The exact number of interrupt levels is processor |
---|
130 | dependent. RTEMS internally supports 256 interrupt levels which |
---|
131 | are mapped to the processor's interrupt levels. For specific |
---|
132 | information on the mapping between RTEMS and the target |
---|
133 | processor's interrupt levels, refer to the Interrupt Processing |
---|
134 | chapter of the Applications Supplement document for a specific |
---|
135 | target processor. |
---|
136 | |
---|
137 | @subsection Disabling of Interrupts by RTEMS |
---|
138 | |
---|
139 | @cindex disabling interrupts |
---|
140 | |
---|
141 | During the execution of directive calls, critical |
---|
142 | sections of code may be executed. When these sections are |
---|
143 | encountered, RTEMS disables all maskable interrupts before the |
---|
144 | execution of the section and restores them to the previous level |
---|
145 | upon completion of the section. RTEMS has been optimized to |
---|
146 | ensure that interrupts are disabled for a minimum length of |
---|
147 | time. The maximum length of time interrupts are disabled by |
---|
148 | RTEMS is processor dependent and is detailed in the Timing |
---|
149 | Specification chapter of the Applications Supplement document |
---|
150 | for a specific target processor. |
---|
151 | |
---|
152 | Non-maskable interrupts (NMI) cannot be disabled, and |
---|
153 | ISRs which execute at this level MUST NEVER issue RTEMS system |
---|
154 | calls. If a directive is invoked, unpredictable results may |
---|
155 | occur due to the inability of RTEMS to protect its critical |
---|
156 | sections. However, ISRs that make no system calls may safely |
---|
157 | execute as non-maskable interrupts. |
---|
158 | |
---|
159 | @section Operations |
---|
160 | |
---|
161 | @subsection Establishing an ISR |
---|
162 | |
---|
163 | The @code{@value{DIRPREFIX}interrupt_catch} |
---|
164 | directive establishes an ISR for |
---|
165 | the system. The address of the ISR and its associated CPU |
---|
166 | vector number are specified to this directive. This directive |
---|
167 | installs the RTEMS interrupt wrapper in the processor's |
---|
168 | Interrupt Vector Table and the address of the user's ISR in the |
---|
169 | RTEMS' Vector Table. This directive returns the previous |
---|
170 | contents of the specified vector in the RTEMS' Vector Table. |
---|
171 | |
---|
172 | @subsection Directives Allowed from an ISR |
---|
173 | |
---|
174 | Using the interrupt manager ensures that RTEMS knows |
---|
175 | when a directive is being called from an ISR. The ISR may then |
---|
176 | use system calls to synchronize itself with an application task. |
---|
177 | The synchronization may involve messages, events or signals |
---|
178 | being passed by the ISR to the desired task. Directives invoked |
---|
179 | by an ISR must operate only on objects which reside on the local |
---|
180 | node. The following is a list of RTEMS system calls that may be |
---|
181 | made from an ISR: |
---|
182 | |
---|
183 | @itemize @bullet |
---|
184 | @item Task Management |
---|
185 | |
---|
186 | Although it is acceptable to operate on the RTEMS_SELF task (e.g. |
---|
187 | the currently executing task), while in an ISR, this will refer |
---|
188 | to the interrupted task. Most of the time, it is an application |
---|
189 | implementation error to use RTEMS_SELF from an ISR. |
---|
190 | |
---|
191 | @itemize |
---|
192 | @item rtems_task_suspend |
---|
193 | @item rtems_task_resume |
---|
194 | @end itemize |
---|
195 | |
---|
196 | @item Interrupt Management |
---|
197 | |
---|
198 | @itemize |
---|
199 | @item rtems_interrupt_enable |
---|
200 | @item rtems_interrupt_disable |
---|
201 | @item rtems_interrupt_flash |
---|
202 | @item rtems_interrupt_lock_acquire |
---|
203 | @item rtems_interrupt_lock_release |
---|
204 | @item rtems_interrupt_lock_acquire_isr |
---|
205 | @item rtems_interrupt_lock_release_isr |
---|
206 | @item rtems_interrupt_is_in_progress |
---|
207 | @item rtems_interrupt_catch |
---|
208 | @end itemize |
---|
209 | |
---|
210 | @item Clock Management |
---|
211 | |
---|
212 | @itemize |
---|
213 | @item rtems_clock_set |
---|
214 | @item rtems_clock_get |
---|
215 | @item rtems_clock_get_tod |
---|
216 | @item rtems_clock_get_tod_timeval |
---|
217 | @item rtems_clock_get_seconds_since_epoch |
---|
218 | @item rtems_clock_get_ticks_per_second |
---|
219 | @item rtems_clock_get_ticks_since_boot |
---|
220 | @item rtems_clock_get_uptime |
---|
221 | @item rtems_clock_set_nanoseconds_extension |
---|
222 | @item rtems_clock_tick |
---|
223 | @end itemize |
---|
224 | |
---|
225 | @item Timer Management |
---|
226 | |
---|
227 | @itemize |
---|
228 | @item rtems_timer_cancel |
---|
229 | @item rtems_timer_reset |
---|
230 | @item rtems_timer_fire_after |
---|
231 | @item rtems_timer_fire_when |
---|
232 | @item rtems_timer_server_fire_after |
---|
233 | @item rtems_timer_server_fire_when |
---|
234 | @end itemize |
---|
235 | |
---|
236 | @item Event Management |
---|
237 | |
---|
238 | @itemize |
---|
239 | @item rtems_event_send |
---|
240 | @item rtems_event_system_send |
---|
241 | @item rtems_event_transient_send |
---|
242 | @end itemize |
---|
243 | |
---|
244 | @item Semaphore Management |
---|
245 | |
---|
246 | @itemize |
---|
247 | @item rtems_semaphore_release |
---|
248 | @end itemize |
---|
249 | |
---|
250 | @item Message Management |
---|
251 | |
---|
252 | @itemize |
---|
253 | @item rtems_message_queue_send |
---|
254 | @item rtems_message_queue_urgent |
---|
255 | @end itemize |
---|
256 | |
---|
257 | @item Signal Management |
---|
258 | |
---|
259 | @itemize |
---|
260 | @item rtems_signal_send |
---|
261 | @end itemize |
---|
262 | |
---|
263 | @item Dual-Ported Memory Management |
---|
264 | |
---|
265 | @itemize |
---|
266 | @item rtems_port_external_to_internal |
---|
267 | @item rtems_port_internal_to_external |
---|
268 | @end itemize |
---|
269 | |
---|
270 | @item IO Management |
---|
271 | |
---|
272 | The following services are safe to call from an ISR if and only if |
---|
273 | the device driver service invoked is also safe. The IO Manager itself |
---|
274 | is safe but the invoked driver entry point may or may not be. |
---|
275 | @itemize |
---|
276 | @item rtems_io_initialize |
---|
277 | @item rtems_io_open |
---|
278 | @item rtems_io_close |
---|
279 | @item rtems_io_read |
---|
280 | @item rtems_io_write |
---|
281 | @item rtems_io_control |
---|
282 | @end itemize |
---|
283 | |
---|
284 | @item Fatal Error Management |
---|
285 | |
---|
286 | @itemize |
---|
287 | @item rtems_fatal |
---|
288 | @item rtems_fatal_error_occurred |
---|
289 | @end itemize |
---|
290 | |
---|
291 | @item Multiprocessing |
---|
292 | |
---|
293 | @itemize |
---|
294 | @item rtems_multiprocessing_announce |
---|
295 | @end itemize |
---|
296 | @end itemize |
---|
297 | |
---|
298 | @section Directives |
---|
299 | |
---|
300 | This section details the interrupt manager's |
---|
301 | directives. A subsection is dedicated to each of this manager's |
---|
302 | directives and describes the calling sequence, related |
---|
303 | constants, usage, and status codes. |
---|
304 | |
---|
305 | @c |
---|
306 | @c |
---|
307 | @c |
---|
308 | @page |
---|
309 | @subsection INTERRUPT_CATCH - Establish an ISR |
---|
310 | |
---|
311 | @cindex establish an ISR |
---|
312 | @cindex install an ISR |
---|
313 | |
---|
314 | @subheading CALLING SEQUENCE: |
---|
315 | |
---|
316 | @ifset is-C |
---|
317 | @findex rtems_interrupt_catch |
---|
318 | @example |
---|
319 | rtems_status_code rtems_interrupt_catch( |
---|
320 | rtems_isr_entry new_isr_handler, |
---|
321 | rtems_vector_number vector, |
---|
322 | rtems_isr_entry *old_isr_handler |
---|
323 | ); |
---|
324 | @end example |
---|
325 | @end ifset |
---|
326 | |
---|
327 | @ifset is-Ada |
---|
328 | @example |
---|
329 | NOT SUPPORTED FROM Ada BINDING |
---|
330 | @end example |
---|
331 | @end ifset |
---|
332 | |
---|
333 | @subheading DIRECTIVE STATUS CODES: |
---|
334 | @code{@value{RPREFIX}SUCCESSFUL} - ISR established successfully@* |
---|
335 | @code{@value{RPREFIX}INVALID_NUMBER} - illegal vector number@* |
---|
336 | @code{@value{RPREFIX}INVALID_ADDRESS} - illegal ISR entry point or invalid @code{old_isr_handler} |
---|
337 | |
---|
338 | @subheading DESCRIPTION: |
---|
339 | |
---|
340 | This directive establishes an interrupt service |
---|
341 | routine (ISR) for the specified interrupt vector number. The |
---|
342 | @code{new_isr_handler} parameter specifies the entry point of the ISR. |
---|
343 | The entry point of the previous ISR for the specified vector is |
---|
344 | returned in @code{old_isr_handler}. |
---|
345 | |
---|
346 | To release an interrupt vector, pass the old handler's address obtained |
---|
347 | when the vector was first capture. |
---|
348 | |
---|
349 | @subheading NOTES: |
---|
350 | |
---|
351 | This directive will not cause the calling task to be preempted. |
---|
352 | |
---|
353 | @c |
---|
354 | @c |
---|
355 | @c |
---|
356 | @page |
---|
357 | @subsection INTERRUPT_DISABLE - Disable Interrupts |
---|
358 | |
---|
359 | @cindex disable interrupts |
---|
360 | |
---|
361 | @subheading CALLING SEQUENCE: |
---|
362 | |
---|
363 | @ifset is-C |
---|
364 | @findex rtems_interrupt_disable |
---|
365 | @example |
---|
366 | void rtems_interrupt_disable( |
---|
367 | rtems_interrupt_level level |
---|
368 | ); |
---|
369 | |
---|
370 | /* this is implemented as a macro and sets level as a side-effect */ |
---|
371 | @end example |
---|
372 | @end ifset |
---|
373 | |
---|
374 | @ifset is-Ada |
---|
375 | @example |
---|
376 | function Interrupt_Disable return RTEMS.ISR_Level; |
---|
377 | @end example |
---|
378 | @end ifset |
---|
379 | |
---|
380 | @subheading DIRECTIVE STATUS CODES: |
---|
381 | |
---|
382 | NONE |
---|
383 | |
---|
384 | @subheading DESCRIPTION: |
---|
385 | |
---|
386 | This directive disables all maskable interrupts and returns |
---|
387 | the previous @code{level}. A later invocation of the |
---|
388 | @code{@value{DIRPREFIX}interrupt_enable} directive should be used to |
---|
389 | restore the interrupt level. |
---|
390 | |
---|
391 | @subheading NOTES: |
---|
392 | |
---|
393 | This directive will not cause the calling task to be preempted. |
---|
394 | |
---|
395 | @ifset is-C |
---|
396 | @b{This directive is implemented as a macro which modifies the @code{level} |
---|
397 | parameter.} |
---|
398 | @end ifset |
---|
399 | |
---|
400 | This directive is only available on uni-processor configurations. The |
---|
401 | directive @code{@value{DIRPREFIX}interrupt_local_disable} is available on all |
---|
402 | configurations. |
---|
403 | |
---|
404 | @c |
---|
405 | @c |
---|
406 | @c |
---|
407 | @page |
---|
408 | @subsection INTERRUPT_ENABLE - Enable Interrupts |
---|
409 | |
---|
410 | @cindex enable interrupts |
---|
411 | |
---|
412 | @subheading CALLING SEQUENCE: |
---|
413 | |
---|
414 | @ifset is-C |
---|
415 | @findex rtems_interrupt_enable |
---|
416 | @example |
---|
417 | void rtems_interrupt_enable( |
---|
418 | rtems_interrupt_level level |
---|
419 | ); |
---|
420 | @end example |
---|
421 | @end ifset |
---|
422 | |
---|
423 | @ifset is-Ada |
---|
424 | @example |
---|
425 | procedure Interrupt_Enable ( |
---|
426 | Level : in RTEMS.ISR_Level |
---|
427 | ); |
---|
428 | @end example |
---|
429 | @end ifset |
---|
430 | |
---|
431 | @subheading DIRECTIVE STATUS CODES: |
---|
432 | |
---|
433 | NONE |
---|
434 | |
---|
435 | @subheading DESCRIPTION: |
---|
436 | |
---|
437 | This directive enables maskable interrupts to the @code{level} |
---|
438 | which was returned by a previous call to |
---|
439 | @code{@value{DIRPREFIX}interrupt_disable}. |
---|
440 | Immediately prior to invoking this directive, maskable interrupts should |
---|
441 | be disabled by a call to @code{@value{DIRPREFIX}interrupt_disable} |
---|
442 | and will be enabled when this directive returns to the caller. |
---|
443 | |
---|
444 | @subheading NOTES: |
---|
445 | |
---|
446 | This directive will not cause the calling task to be preempted. |
---|
447 | |
---|
448 | This directive is only available on uni-processor configurations. The |
---|
449 | directive @code{@value{DIRPREFIX}interrupt_local_enable} is available on all |
---|
450 | configurations. |
---|
451 | |
---|
452 | @c |
---|
453 | @c |
---|
454 | @c |
---|
455 | @page |
---|
456 | @subsection INTERRUPT_FLASH - Flash Interrupts |
---|
457 | |
---|
458 | @cindex flash interrupts |
---|
459 | |
---|
460 | @subheading CALLING SEQUENCE: |
---|
461 | |
---|
462 | @ifset is-C |
---|
463 | @findex rtems_interrupt_flash |
---|
464 | @example |
---|
465 | void rtems_interrupt_flash( |
---|
466 | rtems_interrupt_level level |
---|
467 | ); |
---|
468 | @end example |
---|
469 | @end ifset |
---|
470 | |
---|
471 | @ifset is-Ada |
---|
472 | @example |
---|
473 | procedure Interrupt_Flash ( |
---|
474 | Level : in RTEMS.ISR_Level |
---|
475 | ); |
---|
476 | @end example |
---|
477 | @end ifset |
---|
478 | |
---|
479 | @subheading DIRECTIVE STATUS CODES: |
---|
480 | |
---|
481 | NONE |
---|
482 | |
---|
483 | @subheading DESCRIPTION: |
---|
484 | |
---|
485 | This directive temporarily enables maskable interrupts to the @code{level} |
---|
486 | which was returned by a previous call to |
---|
487 | @code{@value{DIRPREFIX}interrupt_disable}. |
---|
488 | Immediately prior to invoking this directive, maskable interrupts should |
---|
489 | be disabled by a call to @code{@value{DIRPREFIX}interrupt_disable} |
---|
490 | and will be redisabled when this directive returns to the caller. |
---|
491 | |
---|
492 | @subheading NOTES: |
---|
493 | |
---|
494 | This directive will not cause the calling task to be preempted. |
---|
495 | |
---|
496 | This directive is only available on uni-processor configurations. The |
---|
497 | directives @code{@value{DIRPREFIX}interrupt_local_disable} and |
---|
498 | @code{@value{DIRPREFIX}interrupt_local_enable} is available on all |
---|
499 | configurations. |
---|
500 | |
---|
501 | @c |
---|
502 | @c |
---|
503 | @c |
---|
504 | @page |
---|
505 | @subsection INTERRUPT_LOCAL_DISABLE - Disable Interrupts on Current Processor |
---|
506 | |
---|
507 | @cindex disable interrupts |
---|
508 | |
---|
509 | @subheading CALLING SEQUENCE: |
---|
510 | |
---|
511 | @ifset is-C |
---|
512 | @findex rtems_interrupt_local_disable |
---|
513 | @example |
---|
514 | void rtems_interrupt_local_disable( |
---|
515 | rtems_interrupt_level level |
---|
516 | ); |
---|
517 | |
---|
518 | /* this is implemented as a macro and sets level as a side-effect */ |
---|
519 | @end example |
---|
520 | @end ifset |
---|
521 | |
---|
522 | @subheading DIRECTIVE STATUS CODES: |
---|
523 | |
---|
524 | NONE |
---|
525 | |
---|
526 | @subheading DESCRIPTION: |
---|
527 | |
---|
528 | This directive disables all maskable interrupts and returns |
---|
529 | the previous @code{level}. A later invocation of the |
---|
530 | @code{@value{DIRPREFIX}interrupt_local_enable} directive should be used to |
---|
531 | restore the interrupt level. |
---|
532 | |
---|
533 | @subheading NOTES: |
---|
534 | |
---|
535 | This directive will not cause the calling task to be preempted. |
---|
536 | |
---|
537 | @ifset is-C |
---|
538 | @b{This directive is implemented as a macro which modifies the @code{level} |
---|
539 | parameter.} |
---|
540 | @end ifset |
---|
541 | |
---|
542 | On SMP configurations this will not ensure system wide mutual exclusion. Use |
---|
543 | interrupt locks instead. |
---|
544 | |
---|
545 | @c |
---|
546 | @c |
---|
547 | @c |
---|
548 | @page |
---|
549 | @subsection INTERRUPT_LOCAL_ENABLE - Enable Interrupts on Current Processor |
---|
550 | |
---|
551 | @cindex enable interrupts |
---|
552 | |
---|
553 | @subheading CALLING SEQUENCE: |
---|
554 | |
---|
555 | @ifset is-C |
---|
556 | @findex rtems_interrupt_local_enable |
---|
557 | @example |
---|
558 | void rtems_interrupt_local_enable( |
---|
559 | rtems_interrupt_level level |
---|
560 | ); |
---|
561 | @end example |
---|
562 | @end ifset |
---|
563 | |
---|
564 | @subheading DIRECTIVE STATUS CODES: |
---|
565 | |
---|
566 | NONE |
---|
567 | |
---|
568 | @subheading DESCRIPTION: |
---|
569 | |
---|
570 | This directive enables maskable interrupts to the @code{level} |
---|
571 | which was returned by a previous call to |
---|
572 | @code{@value{DIRPREFIX}interrupt_local_disable}. |
---|
573 | Immediately prior to invoking this directive, maskable interrupts should |
---|
574 | be disabled by a call to @code{@value{DIRPREFIX}interrupt_local_disable} |
---|
575 | and will be enabled when this directive returns to the caller. |
---|
576 | |
---|
577 | @subheading NOTES: |
---|
578 | |
---|
579 | This directive will not cause the calling task to be preempted. |
---|
580 | |
---|
581 | @c |
---|
582 | @c |
---|
583 | @c |
---|
584 | @page |
---|
585 | @subsection INTERRUPT_LOCK_INITIALIZE - Initialize an ISR Lock |
---|
586 | |
---|
587 | @subheading CALLING SEQUENCE: |
---|
588 | |
---|
589 | @ifset is-C |
---|
590 | @findex rtems_interrupt_lock_initialize |
---|
591 | @example |
---|
592 | void rtems_interrupt_lock_initialize( |
---|
593 | rtems_interrupt_lock *lock |
---|
594 | ); |
---|
595 | @end example |
---|
596 | @end ifset |
---|
597 | |
---|
598 | @subheading DIRECTIVE STATUS CODES: |
---|
599 | |
---|
600 | NONE |
---|
601 | |
---|
602 | @subheading DESCRIPTION: |
---|
603 | |
---|
604 | Initializes an interrupt lock. |
---|
605 | |
---|
606 | @subheading NOTES: |
---|
607 | |
---|
608 | Concurrent initialization leads to unpredictable results. |
---|
609 | |
---|
610 | @c |
---|
611 | @c |
---|
612 | @c |
---|
613 | @page |
---|
614 | @subsection INTERRUPT_LOCK_ACQUIRE - Acquire an ISR Lock |
---|
615 | |
---|
616 | @subheading CALLING SEQUENCE: |
---|
617 | |
---|
618 | @ifset is-C |
---|
619 | @findex rtems_interrupt_lock_acquire |
---|
620 | @example |
---|
621 | void rtems_interrupt_lock_acquire( |
---|
622 | rtems_interrupt_lock *lock, |
---|
623 | rtems_interrupt_level level |
---|
624 | ); |
---|
625 | @end example |
---|
626 | @end ifset |
---|
627 | |
---|
628 | @subheading DIRECTIVE STATUS CODES: |
---|
629 | |
---|
630 | NONE |
---|
631 | |
---|
632 | @subheading DESCRIPTION: |
---|
633 | |
---|
634 | Interrupts will be disabled. On SMP configurations this directive acquires a |
---|
635 | SMP lock. |
---|
636 | |
---|
637 | @subheading NOTES: |
---|
638 | |
---|
639 | This directive will not cause the calling thread to be preempted. This |
---|
640 | directive can be used in thread and interrupt context. |
---|
641 | |
---|
642 | @c |
---|
643 | @c |
---|
644 | @c |
---|
645 | @page |
---|
646 | @subsection INTERRUPT_LOCK_RELEASE - Release an ISR Lock |
---|
647 | |
---|
648 | @subheading CALLING SEQUENCE: |
---|
649 | |
---|
650 | @ifset is-C |
---|
651 | @findex rtems_interrupt_lock_release |
---|
652 | @example |
---|
653 | void rtems_interrupt_lock_release( |
---|
654 | rtems_interrupt_lock *lock, |
---|
655 | rtems_interrupt_level level |
---|
656 | ); |
---|
657 | @end example |
---|
658 | @end ifset |
---|
659 | |
---|
660 | @subheading DIRECTIVE STATUS CODES: |
---|
661 | |
---|
662 | NONE |
---|
663 | |
---|
664 | @subheading DESCRIPTION: |
---|
665 | |
---|
666 | The interrupt status will be restored. On SMP configurations this directive |
---|
667 | releases a SMP lock. |
---|
668 | |
---|
669 | @subheading NOTES: |
---|
670 | |
---|
671 | This directive will not cause the calling thread to be preempted. This |
---|
672 | directive can be used in thread and interrupt context. |
---|
673 | |
---|
674 | @c |
---|
675 | @c |
---|
676 | @c |
---|
677 | @page |
---|
678 | @subsection INTERRUPT_LOCK_ACQUIRE_ISR - Acquire an ISR Lock from ISR |
---|
679 | |
---|
680 | @subheading CALLING SEQUENCE: |
---|
681 | |
---|
682 | @ifset is-C |
---|
683 | @findex rtems_interrupt_lock_acquire_isr |
---|
684 | @example |
---|
685 | void rtems_interrupt_lock_acquire_isr( |
---|
686 | rtems_interrupt_lock *lock, |
---|
687 | rtems_interrupt_level level |
---|
688 | ); |
---|
689 | @end example |
---|
690 | @end ifset |
---|
691 | |
---|
692 | @subheading DIRECTIVE STATUS CODES: |
---|
693 | |
---|
694 | NONE |
---|
695 | |
---|
696 | @subheading DESCRIPTION: |
---|
697 | |
---|
698 | The interrupt status will remain unchanged. On SMP configurations this |
---|
699 | directive acquires a SMP lock. |
---|
700 | |
---|
701 | In case the corresponding interrupt service routine can be interrupted by |
---|
702 | higher priority interrupts and these interrupts enter the critical section |
---|
703 | protected by this lock, then the result is unpredictable. |
---|
704 | |
---|
705 | @subheading NOTES: |
---|
706 | |
---|
707 | This directive should be called from the corresponding interrupt service |
---|
708 | routine. |
---|
709 | |
---|
710 | @c |
---|
711 | @c |
---|
712 | @c |
---|
713 | @page |
---|
714 | @subsection INTERRUPT_LOCK_RELEASE_ISR - Release an ISR Lock from ISR |
---|
715 | |
---|
716 | @subheading CALLING SEQUENCE: |
---|
717 | |
---|
718 | @ifset is-C |
---|
719 | @findex rtems_interrupt_lock_release_isr |
---|
720 | @example |
---|
721 | void rtems_interrupt_lock_release_isr( |
---|
722 | rtems_interrupt_lock *lock, |
---|
723 | rtems_interrupt_level level |
---|
724 | ); |
---|
725 | @end example |
---|
726 | @end ifset |
---|
727 | |
---|
728 | @subheading DIRECTIVE STATUS CODES: |
---|
729 | |
---|
730 | NONE |
---|
731 | |
---|
732 | @subheading DESCRIPTION: |
---|
733 | |
---|
734 | The interrupt status will remain unchanged. On SMP configurations this |
---|
735 | directive releases a SMP lock. |
---|
736 | |
---|
737 | @subheading NOTES: |
---|
738 | |
---|
739 | This directive should be called from the corresponding interrupt service |
---|
740 | routine. |
---|
741 | |
---|
742 | @c |
---|
743 | @c |
---|
744 | @c |
---|
745 | @page |
---|
746 | @subsection INTERRUPT_IS_IN_PROGRESS - Is an ISR in Progress |
---|
747 | |
---|
748 | @cindex is interrupt in progress |
---|
749 | |
---|
750 | @subheading CALLING SEQUENCE: |
---|
751 | |
---|
752 | @ifset is-C |
---|
753 | @findex rtems_interrupt_is_in_progress |
---|
754 | @example |
---|
755 | bool rtems_interrupt_is_in_progress( void ); |
---|
756 | @end example |
---|
757 | @end ifset |
---|
758 | |
---|
759 | @ifset is-Ada |
---|
760 | @example |
---|
761 | function Interrupt_Is_In_Progress return RTEMS.Boolean; |
---|
762 | @end example |
---|
763 | @end ifset |
---|
764 | |
---|
765 | @subheading DIRECTIVE STATUS CODES: |
---|
766 | |
---|
767 | NONE |
---|
768 | |
---|
769 | @subheading DESCRIPTION: |
---|
770 | |
---|
771 | This directive returns @code{TRUE} if the processor is currently |
---|
772 | servicing an interrupt and @code{FALSE} otherwise. A return value |
---|
773 | of @code{TRUE} indicates that the caller is an interrupt service |
---|
774 | routine, @b{NOT} a task. The directives available to an interrupt |
---|
775 | service routine are restricted. |
---|
776 | |
---|
777 | @subheading NOTES: |
---|
778 | |
---|
779 | This directive will not cause the calling task to be preempted. |
---|
780 | |
---|