1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
---|
2 | |
---|
3 | /** |
---|
4 | * @file |
---|
5 | * |
---|
6 | * @brief This header file provides the task modes API of the Task Manager. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) |
---|
11 | * Copyright (C) 2008 On-Line Applications Research Corporation (OAR) |
---|
12 | * |
---|
13 | * Redistribution and use in source and binary forms, with or without |
---|
14 | * modification, are permitted provided that the following conditions |
---|
15 | * are met: |
---|
16 | * 1. Redistributions of source code must retain the above copyright |
---|
17 | * notice, this list of conditions and the following disclaimer. |
---|
18 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
19 | * notice, this list of conditions and the following disclaimer in the |
---|
20 | * documentation and/or other materials provided with the distribution. |
---|
21 | * |
---|
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
---|
26 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
27 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
28 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
29 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
30 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
31 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
32 | * POSSIBILITY OF SUCH DAMAGE. |
---|
33 | */ |
---|
34 | |
---|
35 | /* |
---|
36 | * This file is part of the RTEMS quality process and was automatically |
---|
37 | * generated. If you find something that needs to be fixed or |
---|
38 | * worded better please post a report or patch to an RTEMS mailing list |
---|
39 | * or raise a bug report: |
---|
40 | * |
---|
41 | * https://docs.rtems.org/branches/master/user/support/bugs.html |
---|
42 | * |
---|
43 | * For information on updating and regenerating please refer to: |
---|
44 | * |
---|
45 | * https://docs.rtems.org/branches/master/eng/req/howto.html |
---|
46 | */ |
---|
47 | |
---|
48 | /* Generated from spec:/rtems/mode/if/header */ |
---|
49 | |
---|
50 | #ifndef _RTEMS_RTEMS_MODES_H |
---|
51 | #define _RTEMS_RTEMS_MODES_H |
---|
52 | |
---|
53 | #include <stdint.h> |
---|
54 | #include <rtems/score/cpu.h> |
---|
55 | |
---|
56 | #ifdef __cplusplus |
---|
57 | extern "C" { |
---|
58 | #endif |
---|
59 | |
---|
60 | /* Generated from spec:/rtems/mode/if/group */ |
---|
61 | |
---|
62 | /** |
---|
63 | * @defgroup RTEMSAPIClassicModes Task Modes |
---|
64 | * |
---|
65 | * @ingroup RTEMSAPIClassic |
---|
66 | * |
---|
67 | * @brief This group contains the Classic API task modes. |
---|
68 | */ |
---|
69 | |
---|
70 | /* Generated from spec:/rtems/mode/if/all-mode-masks */ |
---|
71 | |
---|
72 | /** |
---|
73 | * @ingroup RTEMSAPIClassicModes |
---|
74 | * |
---|
75 | * @brief This task mode constant is a bit mask with all mode bits set. |
---|
76 | */ |
---|
77 | #define RTEMS_ALL_MODE_MASKS 0x0000ffff |
---|
78 | |
---|
79 | /* Generated from spec:/rtems/mode/if/asr */ |
---|
80 | |
---|
81 | /** |
---|
82 | * @ingroup RTEMSAPIClassicModes |
---|
83 | * |
---|
84 | * @brief This task mode constant indicates that signal processing is disabled. |
---|
85 | */ |
---|
86 | #define RTEMS_ASR 0x00000000 |
---|
87 | |
---|
88 | /* Generated from spec:/rtems/mode/if/asr-mask */ |
---|
89 | |
---|
90 | /** |
---|
91 | * @ingroup RTEMSAPIClassicModes |
---|
92 | * |
---|
93 | * @brief This mode constant corresponds to the signal enable/disable bit. |
---|
94 | */ |
---|
95 | #define RTEMS_ASR_MASK 0x00000400 |
---|
96 | |
---|
97 | /* Generated from spec:/rtems/mode/if/current-mode */ |
---|
98 | |
---|
99 | /** |
---|
100 | * @ingroup RTEMSAPIClassicModes |
---|
101 | * |
---|
102 | * @brief This task mode constant indicates that the current task mode of the |
---|
103 | * executing task shall be returned by rtems_task_mode(). |
---|
104 | */ |
---|
105 | #define RTEMS_CURRENT_MODE 0 |
---|
106 | |
---|
107 | /* Generated from spec:/rtems/mode/if/default */ |
---|
108 | |
---|
109 | /** |
---|
110 | * @ingroup RTEMSAPIClassicModes |
---|
111 | * |
---|
112 | * @brief This task mode constant represents the default mode set. |
---|
113 | */ |
---|
114 | #define RTEMS_DEFAULT_MODES 0x00000000 |
---|
115 | |
---|
116 | /* Generated from spec:/rtems/mode/if/interrupt-mask */ |
---|
117 | |
---|
118 | /** |
---|
119 | * @ingroup RTEMSAPIClassicModes |
---|
120 | * |
---|
121 | * @brief This task mode constant corresponds to the interrupt enable/disable |
---|
122 | * bits. |
---|
123 | */ |
---|
124 | #define RTEMS_INTERRUPT_MASK CPU_MODES_INTERRUPT_MASK |
---|
125 | |
---|
126 | /* Generated from spec:/rtems/mode/if/interrupt-level */ |
---|
127 | |
---|
128 | /** |
---|
129 | * @ingroup RTEMSAPIClassicModes |
---|
130 | * |
---|
131 | * @brief Maps the interrupt level to the associated processor-dependent task |
---|
132 | * mode interrupt level. |
---|
133 | * |
---|
134 | * The Classic API supports 256 interrupt levels using the least significant |
---|
135 | * eight bits of the mode set. On any particular processor variant, fewer than |
---|
136 | * 256 levels may be supported. At least level 0 (all interrupts enabled) and |
---|
137 | * level 1 (interrupts disabled, on most architectures) are supported. |
---|
138 | * |
---|
139 | * @param _interrupt_level is the interrupt level to map. |
---|
140 | * |
---|
141 | * @return Returns the processor-dependent task mode interrupt level associated |
---|
142 | * with the interrupt level. |
---|
143 | */ |
---|
144 | #define RTEMS_INTERRUPT_LEVEL( _interrupt_level ) \ |
---|
145 | ( ( _interrupt_level ) & RTEMS_INTERRUPT_MASK ) |
---|
146 | |
---|
147 | /* Generated from spec:/rtems/mode/if/interrupt-mask-constant */ |
---|
148 | |
---|
149 | /** |
---|
150 | * @ingroup RTEMSAPIClassicModes |
---|
151 | * |
---|
152 | * @brief This task mode constant has the same value as #RTEMS_INTERRUPT_MASK. |
---|
153 | * |
---|
154 | * This task mode constant is used by bindings from languages other than C and |
---|
155 | * C++. |
---|
156 | */ |
---|
157 | extern const uint32_t rtems_interrupt_mask; |
---|
158 | |
---|
159 | /* Generated from spec:/rtems/mode/if/mode */ |
---|
160 | |
---|
161 | /** |
---|
162 | * @ingroup RTEMSAPIClassicModes |
---|
163 | * |
---|
164 | * @brief This type represents a Classic API task mode set. |
---|
165 | */ |
---|
166 | typedef uint32_t rtems_mode; |
---|
167 | |
---|
168 | /* Generated from spec:/rtems/mode/if/interrupt-level-body */ |
---|
169 | |
---|
170 | /** |
---|
171 | * @ingroup RTEMSAPIClassicModes |
---|
172 | * |
---|
173 | * @brief Maps the interrupt level to the associated processor-dependent task |
---|
174 | * mode interrupt level. |
---|
175 | * |
---|
176 | * This function is used by bindings from languages other than C and C++. |
---|
177 | * |
---|
178 | * @param level is the interrupt level to map. |
---|
179 | * |
---|
180 | * @return Returns RTEMS_INTERRUPT_LEVEL() for the interrupt level. |
---|
181 | */ |
---|
182 | rtems_mode rtems_interrupt_level_body( uint32_t level ); |
---|
183 | |
---|
184 | /* Generated from spec:/rtems/mode/if/no-asr */ |
---|
185 | |
---|
186 | /** |
---|
187 | * @ingroup RTEMSAPIClassicModes |
---|
188 | * |
---|
189 | * @brief This task mode constant indicates that signal processing is disabled. |
---|
190 | */ |
---|
191 | #define RTEMS_NO_ASR 0x00000400 |
---|
192 | |
---|
193 | /* Generated from spec:/rtems/mode/if/no-preempt */ |
---|
194 | |
---|
195 | /** |
---|
196 | * @ingroup RTEMSAPIClassicModes |
---|
197 | * |
---|
198 | * @brief This task mode constant indicates that preemption is disabled. |
---|
199 | */ |
---|
200 | #define RTEMS_NO_PREEMPT 0x00000100 |
---|
201 | |
---|
202 | /* Generated from spec:/rtems/mode/if/no-timeslice */ |
---|
203 | |
---|
204 | /** |
---|
205 | * @ingroup RTEMSAPIClassicModes |
---|
206 | * |
---|
207 | * @brief This task mode constant indicates that timeslicing is disabled. |
---|
208 | */ |
---|
209 | #define RTEMS_NO_TIMESLICE 0x00000000 |
---|
210 | |
---|
211 | /* Generated from spec:/rtems/mode/if/preempt */ |
---|
212 | |
---|
213 | /** |
---|
214 | * @ingroup RTEMSAPIClassicModes |
---|
215 | * |
---|
216 | * @brief This task mode constant indicates that preemption is enabled. |
---|
217 | */ |
---|
218 | #define RTEMS_PREEMPT 0x00000000 |
---|
219 | |
---|
220 | /* Generated from spec:/rtems/mode/if/preempt-mask */ |
---|
221 | |
---|
222 | /** |
---|
223 | * @ingroup RTEMSAPIClassicModes |
---|
224 | * |
---|
225 | * @brief This task mode constant corresponds to the preemption enable/disable |
---|
226 | * bit. |
---|
227 | */ |
---|
228 | #define RTEMS_PREEMPT_MASK 0x00000100 |
---|
229 | |
---|
230 | /* Generated from spec:/rtems/mode/if/timeslice */ |
---|
231 | |
---|
232 | /** |
---|
233 | * @ingroup RTEMSAPIClassicModes |
---|
234 | * |
---|
235 | * @brief This task mode constant indicates that timeslicing is enabled. |
---|
236 | */ |
---|
237 | #define RTEMS_TIMESLICE 0x00000200 |
---|
238 | |
---|
239 | /* Generated from spec:/rtems/mode/if/timeslice-mask */ |
---|
240 | |
---|
241 | /** |
---|
242 | * @ingroup RTEMSAPIClassicModes |
---|
243 | * |
---|
244 | * @brief This task mode constant corresponds to the timeslice enable/disable |
---|
245 | * bit. |
---|
246 | */ |
---|
247 | #define RTEMS_TIMESLICE_MASK 0x00000200 |
---|
248 | |
---|
249 | #ifdef __cplusplus |
---|
250 | } |
---|
251 | #endif |
---|
252 | |
---|
253 | #endif /* _RTEMS_RTEMS_MODES_H */ |
---|