1 | /** |
---|
2 | * @file rtems/rtems/asr.h |
---|
3 | * |
---|
4 | * @defgroup ClassicASR ASR Support |
---|
5 | * |
---|
6 | * @ingroup ClassicRTEMS |
---|
7 | * @brief Asynchronous Signal Handler |
---|
8 | * |
---|
9 | * This include file contains all the constants and structures associated |
---|
10 | * with the Asynchronous Signal Handler. This Handler provides the low-level |
---|
11 | * support required by the Signal Manager. |
---|
12 | */ |
---|
13 | |
---|
14 | /* COPYRIGHT (c) 1989-2013. |
---|
15 | * On-Line Applications Research Corporation (OAR). |
---|
16 | * |
---|
17 | * The license and distribution terms for this file may be |
---|
18 | * found in the file LICENSE in this distribution or at |
---|
19 | * http://www.rtems.com/license/LICENSE. |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef _RTEMS_RTEMS_ASR_H |
---|
23 | #define _RTEMS_RTEMS_ASR_H |
---|
24 | |
---|
25 | #include <rtems/score/isrlock.h> |
---|
26 | #include <rtems/rtems/modes.h> |
---|
27 | |
---|
28 | #ifdef __cplusplus |
---|
29 | extern "C" { |
---|
30 | #endif |
---|
31 | |
---|
32 | /** |
---|
33 | * @defgroup ClassicASR ASR Support |
---|
34 | * |
---|
35 | * @ingroup ClassicRTEMS |
---|
36 | * |
---|
37 | * This encapsulates functionality related to the Classic API Signal |
---|
38 | * Manager. |
---|
39 | */ |
---|
40 | /**@{*/ |
---|
41 | |
---|
42 | /** |
---|
43 | * The following type defines the control block used to manage |
---|
44 | * each signal set. |
---|
45 | */ |
---|
46 | typedef uint32_t rtems_signal_set; |
---|
47 | |
---|
48 | /** |
---|
49 | * Return type for ASR Handler |
---|
50 | */ |
---|
51 | typedef void rtems_asr; |
---|
52 | |
---|
53 | /** |
---|
54 | * The following type corresponds to the applications asynchronous |
---|
55 | * signal processing routine. |
---|
56 | */ |
---|
57 | typedef rtems_asr ( *rtems_asr_entry )( |
---|
58 | rtems_signal_set |
---|
59 | ); |
---|
60 | |
---|
61 | /** |
---|
62 | * The following defines the control structure used to manage |
---|
63 | * signals. Each thread has a copy of this record. |
---|
64 | */ |
---|
65 | typedef struct { |
---|
66 | /** This field indicates if are ASRs enabled currently. */ |
---|
67 | bool is_enabled; |
---|
68 | /** This field indicates if address of the signal handler function. */ |
---|
69 | rtems_asr_entry handler; |
---|
70 | /** This field indicates if the task mode the signal will run with. */ |
---|
71 | Modes_Control mode_set; |
---|
72 | /** This field indicates the signal set that is posted. */ |
---|
73 | rtems_signal_set signals_posted; |
---|
74 | /** This field indicates the signal set that is pending. */ |
---|
75 | rtems_signal_set signals_pending; |
---|
76 | /** This field indicates if nest level of signals being processed */ |
---|
77 | uint32_t nest_level; |
---|
78 | /** Lock to protect this structure */ |
---|
79 | ISR_lock_Control Lock; |
---|
80 | } ASR_Information; |
---|
81 | |
---|
82 | /* |
---|
83 | * The following constants define the individual signals which may |
---|
84 | * be used to compose a signal set. |
---|
85 | */ |
---|
86 | |
---|
87 | /** This defines the bit in the signal set associated with signal 0. */ |
---|
88 | #define RTEMS_SIGNAL_0 0x00000001 |
---|
89 | /** This defines the bit in the signal set associated with signal 1. */ |
---|
90 | #define RTEMS_SIGNAL_1 0x00000002 |
---|
91 | /** This defines the bit in the signal set associated with signal 2. */ |
---|
92 | #define RTEMS_SIGNAL_2 0x00000004 |
---|
93 | /** This defines the bit in the signal set associated with signal 3. */ |
---|
94 | #define RTEMS_SIGNAL_3 0x00000008 |
---|
95 | /** This defines the bit in the signal set associated with signal 4. */ |
---|
96 | #define RTEMS_SIGNAL_4 0x00000010 |
---|
97 | /** This defines the bit in the signal set associated with signal 5. */ |
---|
98 | #define RTEMS_SIGNAL_5 0x00000020 |
---|
99 | /** This defines the bit in the signal set associated with signal 6. */ |
---|
100 | #define RTEMS_SIGNAL_6 0x00000040 |
---|
101 | /** This defines the bit in the signal set associated with signal 7. */ |
---|
102 | #define RTEMS_SIGNAL_7 0x00000080 |
---|
103 | /** This defines the bit in the signal set associated with signal 8. */ |
---|
104 | #define RTEMS_SIGNAL_8 0x00000100 |
---|
105 | /** This defines the bit in the signal set associated with signal 9. */ |
---|
106 | #define RTEMS_SIGNAL_9 0x00000200 |
---|
107 | /** This defines the bit in the signal set associated with signal 10. */ |
---|
108 | #define RTEMS_SIGNAL_10 0x00000400 |
---|
109 | /** This defines the bit in the signal set associated with signal 11. */ |
---|
110 | #define RTEMS_SIGNAL_11 0x00000800 |
---|
111 | /** This defines the bit in the signal set associated with signal 12. */ |
---|
112 | #define RTEMS_SIGNAL_12 0x00001000 |
---|
113 | /** This defines the bit in the signal set associated with signal 13. */ |
---|
114 | #define RTEMS_SIGNAL_13 0x00002000 |
---|
115 | /** This defines the bit in the signal set associated with signal 14. */ |
---|
116 | #define RTEMS_SIGNAL_14 0x00004000 |
---|
117 | /** This defines the bit in the signal set associated with signal 15. */ |
---|
118 | #define RTEMS_SIGNAL_15 0x00008000 |
---|
119 | /** This defines the bit in the signal set associated with signal 16. */ |
---|
120 | #define RTEMS_SIGNAL_16 0x00010000 |
---|
121 | /** This defines the bit in the signal set associated with signal 17. */ |
---|
122 | #define RTEMS_SIGNAL_17 0x00020000 |
---|
123 | /** This defines the bit in the signal set associated with signal 18. */ |
---|
124 | #define RTEMS_SIGNAL_18 0x00040000 |
---|
125 | /** This defines the bit in the signal set associated with signal 19. */ |
---|
126 | #define RTEMS_SIGNAL_19 0x00080000 |
---|
127 | /** This defines the bit in the signal set associated with signal 20. */ |
---|
128 | #define RTEMS_SIGNAL_20 0x00100000 |
---|
129 | /** This defines the bit in the signal set associated with signal 21. */ |
---|
130 | #define RTEMS_SIGNAL_21 0x00200000 |
---|
131 | /** This defines the bit in the signal set associated with signal 22. */ |
---|
132 | #define RTEMS_SIGNAL_22 0x00400000 |
---|
133 | /** This defines the bit in the signal set associated with signal 23. */ |
---|
134 | #define RTEMS_SIGNAL_23 0x00800000 |
---|
135 | /** This defines the bit in the signal set associated with signal 24. */ |
---|
136 | #define RTEMS_SIGNAL_24 0x01000000 |
---|
137 | /** This defines the bit in the signal set associated with signal 25. */ |
---|
138 | #define RTEMS_SIGNAL_25 0x02000000 |
---|
139 | /** This defines the bit in the signal set associated with signal 26. */ |
---|
140 | #define RTEMS_SIGNAL_26 0x04000000 |
---|
141 | /** This defines the bit in the signal set associated with signal 27. */ |
---|
142 | #define RTEMS_SIGNAL_27 0x08000000 |
---|
143 | /** This defines the bit in the signal set associated with signal 28. */ |
---|
144 | #define RTEMS_SIGNAL_28 0x10000000 |
---|
145 | /** This defines the bit in the signal set associated with signal 29. */ |
---|
146 | #define RTEMS_SIGNAL_29 0x20000000 |
---|
147 | /** This defines the bit in the signal set associated with signal 30. */ |
---|
148 | #define RTEMS_SIGNAL_30 0x40000000 |
---|
149 | /** This defines the bit in the signal set associated with signal 31. */ |
---|
150 | #define RTEMS_SIGNAL_31 0x80000000 |
---|
151 | |
---|
152 | /**@}*/ |
---|
153 | |
---|
154 | #ifdef __cplusplus |
---|
155 | } |
---|
156 | #endif |
---|
157 | |
---|
158 | #endif |
---|
159 | /* end of include file */ |
---|