1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup RTEMSImplClassic |
---|
5 | * |
---|
6 | * @brief This source file contains the implementation of |
---|
7 | * directive bindings of the Interrupt Manager for languages other than |
---|
8 | * C/C++. |
---|
9 | */ |
---|
10 | |
---|
11 | /* |
---|
12 | * COPYRIGHT (c) 1989-2013. |
---|
13 | * On-Line Applications Research Corporation (OAR). |
---|
14 | * |
---|
15 | * The license and distribution terms for this file may be |
---|
16 | * found in the file LICENSE in this distribution or at |
---|
17 | * http://www.rtems.org/license/LICENSE. |
---|
18 | */ |
---|
19 | |
---|
20 | #ifdef HAVE_CONFIG_H |
---|
21 | #include "config.h" |
---|
22 | #endif |
---|
23 | |
---|
24 | #include <rtems/rtems/status.h> |
---|
25 | #include <rtems/score/isr.h> |
---|
26 | #include <rtems/rtems/intr.h> |
---|
27 | |
---|
28 | #if !defined(RTEMS_SMP) |
---|
29 | |
---|
30 | /* |
---|
31 | * Undefine all of these is normally a macro and we want a real body in |
---|
32 | * the library for other language bindings. |
---|
33 | */ |
---|
34 | #undef rtems_interrupt_disable |
---|
35 | #undef rtems_interrupt_enable |
---|
36 | #undef rtems_interrupt_flash |
---|
37 | |
---|
38 | /* |
---|
39 | * Prototype them to avoid warnings |
---|
40 | */ |
---|
41 | rtems_interrupt_level rtems_interrupt_disable( void ); |
---|
42 | void rtems_interrupt_enable( rtems_interrupt_level previous_level ); |
---|
43 | void rtems_interrupt_flash( rtems_interrupt_level previous_level ); |
---|
44 | |
---|
45 | /* |
---|
46 | * Now define real bodies |
---|
47 | */ |
---|
48 | rtems_interrupt_level rtems_interrupt_disable( void ) |
---|
49 | { |
---|
50 | rtems_interrupt_level previous_level; |
---|
51 | |
---|
52 | _ISR_Local_disable( previous_level ); |
---|
53 | |
---|
54 | return previous_level; |
---|
55 | } |
---|
56 | |
---|
57 | void rtems_interrupt_enable( |
---|
58 | rtems_interrupt_level previous_level |
---|
59 | ) |
---|
60 | { |
---|
61 | _ISR_Local_enable( previous_level ); |
---|
62 | } |
---|
63 | |
---|
64 | void rtems_interrupt_flash( |
---|
65 | rtems_interrupt_level previous_level |
---|
66 | ) |
---|
67 | { |
---|
68 | _ISR_Local_flash( previous_level ); |
---|
69 | } |
---|
70 | |
---|
71 | #endif /* RTEMS_SMP */ |
---|
72 | |
---|
73 | #undef rtems_interrupt_is_in_progress |
---|
74 | bool rtems_interrupt_is_in_progress( void ); |
---|
75 | |
---|
76 | bool rtems_interrupt_is_in_progress( void ) |
---|
77 | { |
---|
78 | return _ISR_Is_in_progress(); |
---|
79 | } |
---|