RTEMS CPU Kit with SuperCore  4.11.3
asrimpl.h
Go to the documentation of this file.
1 
9 /* COPYRIGHT (c) 1989-2008.
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 #ifndef _RTEMS_RTEMS_ASRIMPL_H
18 #define _RTEMS_RTEMS_ASRIMPL_H
19 
20 #include <rtems/rtems/asr.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
40  ASR_Information *asr
41 )
42 {
43  asr->is_enabled = false;
44  asr->handler = NULL;
46  asr->signals_posted = 0;
47  asr->signals_pending = 0;
48  asr->nest_level = 0;
49 }
50 
51 RTEMS_INLINE_ROUTINE void _ASR_Create( ASR_Information *asr )
52 {
53  _ISR_lock_Initialize( &asr->Lock, "ASR" );
54  _ASR_Initialize( asr );
55 }
56 
57 RTEMS_INLINE_ROUTINE void _ASR_Destroy( ASR_Information *asr )
58 {
59  _ISR_lock_Destroy( &asr->Lock );
60 }
61 
70  ASR_Information *asr
71 )
72 {
73  rtems_signal_set _signals;
74  ISR_lock_Context lock_context;
75 
76  _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context );
77  _signals = asr->signals_pending;
78  asr->signals_pending = asr->signals_posted;
79  asr->signals_posted = _signals;
80  _ISR_lock_Release_and_ISR_enable( &asr->Lock, &lock_context );
81 }
82 
90  rtems_asr_entry asr_handler
91 )
92 {
93  return asr_handler == NULL;
94 }
95 
103  ASR_Information *asr
104 )
105 {
106  return asr->signals_posted != 0;
107 }
108 
118  ASR_Information *asr,
119  rtems_signal_set signals,
120  rtems_signal_set *signal_set
121 )
122 {
123  ISR_lock_Context lock_context;
124 
125  _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context );
126  *signal_set |= signals;
127  _ISR_lock_Release_and_ISR_enable( &asr->Lock, &lock_context );
128 }
129 
130 RTEMS_INLINE_ROUTINE rtems_signal_set _ASR_Get_posted_signals(
131  ASR_Information *asr
132 )
133 {
134  rtems_signal_set signal_set;
135  ISR_lock_Context lock_context;
136 
137  _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context );
138  signal_set = asr->signals_posted;
139  asr->signals_posted = 0;
140  _ISR_lock_Release_and_ISR_enable( &asr->Lock, &lock_context );
141 
142  return signal_set;
143 }
144 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 #endif
152 /* end of include file */
RTEMS_INLINE_ROUTINE bool _ASR_Are_signals_pending(ASR_Information *asr)
ASR_Are_signals_pending.
Definition: asrimpl.h:102
rtems_signal_set signals_posted
This field indicates the signal set that is posted.
Definition: asr.h:73
#define _ISR_lock_ISR_disable_and_acquire(_lock, _context)
Acquires an ISR lock.
Definition: isrlock.h:205
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
#define _ISR_lock_Initialize(_lock, _name)
Initializes an ISR lock.
Definition: isrlock.h:167
RTEMS_INLINE_ROUTINE void _ASR_Initialize(ASR_Information *asr)
ASR_Initialize.
Definition: asrimpl.h:39
Modes_Control mode_set
This field indicates if the task mode the signal will run with.
Definition: asr.h:71
bool is_enabled
This field indicates if are ASRs enabled currently.
Definition: asr.h:67
uint32_t rtems_signal_set
The following type defines the control block used to manage each signal set.
Definition: asr.h:46
#define RTEMS_DEFAULT_MODES
This mode constant is the default mode set.
Definition: modes.h:55
RTEMS_INLINE_ROUTINE void _ASR_Swap_signals(ASR_Information *asr)
ASR_Swap_signals.
Definition: asrimpl.h:69
RTEMS_INLINE_ROUTINE bool _ASR_Is_null_handler(rtems_asr_entry asr_handler)
ASR_Is_null_handler.
Definition: asrimpl.h:89
#define _ISR_lock_Release_and_ISR_enable(_lock, _context)
Releases an ISR lock.
Definition: isrlock.h:230
rtems_asr(* rtems_asr_entry)(rtems_signal_set)
The following type corresponds to the applications asynchronous signal processing routine...
Definition: asr.h:57
rtems_asr_entry handler
This field indicates if address of the signal handler function.
Definition: asr.h:69
ISR_lock_Control Lock
Lock to protect this structure.
Definition: asr.h:79
The following defines the control structure used to manage signals.
Definition: asr.h:65
RTEMS_INLINE_ROUTINE void _ASR_Post_signals(ASR_Information *asr, rtems_signal_set signals, rtems_signal_set *signal_set)
ASR_Post_signals.
Definition: asrimpl.h:117
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
rtems_signal_set signals_pending
This field indicates the signal set that is pending.
Definition: asr.h:75
#define _ISR_lock_Destroy(_lock)
Destroys an ISR lock.
Definition: isrlock.h:181
uint32_t nest_level
This field indicates if nest level of signals being processed.
Definition: asr.h:77