1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief RTEMS Interrupt Support |
---|
5 | * @ingroup ClassicINTR |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2013. |
---|
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.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <rtems/system.h> |
---|
22 | #include <rtems/rtems/status.h> |
---|
23 | #include <rtems/score/isr.h> |
---|
24 | #include <rtems/rtems/intr.h> |
---|
25 | |
---|
26 | #if !defined(RTEMS_SMP) |
---|
27 | |
---|
28 | /* |
---|
29 | * Undefine all of these is normally a macro and we want a real body in |
---|
30 | * the library for other language bindings. |
---|
31 | */ |
---|
32 | #undef rtems_interrupt_disable |
---|
33 | #undef rtems_interrupt_enable |
---|
34 | #undef rtems_interrupt_flash |
---|
35 | |
---|
36 | /* |
---|
37 | * Prototype them to avoid warnings |
---|
38 | */ |
---|
39 | rtems_interrupt_level rtems_interrupt_disable( void ); |
---|
40 | void rtems_interrupt_enable( rtems_interrupt_level previous_level ); |
---|
41 | void rtems_interrupt_flash( rtems_interrupt_level previous_level ); |
---|
42 | |
---|
43 | /* |
---|
44 | * Now define real bodies |
---|
45 | */ |
---|
46 | rtems_interrupt_level rtems_interrupt_disable( void ) |
---|
47 | { |
---|
48 | rtems_interrupt_level previous_level; |
---|
49 | |
---|
50 | _ISR_Local_disable( previous_level ); |
---|
51 | |
---|
52 | return previous_level; |
---|
53 | } |
---|
54 | |
---|
55 | void rtems_interrupt_enable( |
---|
56 | rtems_interrupt_level previous_level |
---|
57 | ) |
---|
58 | { |
---|
59 | _ISR_Local_enable( previous_level ); |
---|
60 | } |
---|
61 | |
---|
62 | void rtems_interrupt_flash( |
---|
63 | rtems_interrupt_level previous_level |
---|
64 | ) |
---|
65 | { |
---|
66 | _ISR_Local_flash( previous_level ); |
---|
67 | } |
---|
68 | |
---|
69 | #endif /* RTEMS_SMP */ |
---|
70 | |
---|
71 | #undef rtems_interrupt_is_in_progress |
---|
72 | bool rtems_interrupt_is_in_progress( void ); |
---|
73 | |
---|
74 | bool rtems_interrupt_is_in_progress( void ) |
---|
75 | { |
---|
76 | return _ISR_Is_in_progress(); |
---|
77 | } |
---|