1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
---|
2 | |
---|
3 | /** |
---|
4 | * @file |
---|
5 | * |
---|
6 | * @brief This header file provides the Object Services API. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (C) 2020, 2021 embedded brains GmbH (http://www.embedded-brains.de) |
---|
11 | * Copyright (C) 1988, 2009 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://www.rtems.org/bugs.html |
---|
42 | * |
---|
43 | * For information on updating and regenerating please refer to the How-To |
---|
44 | * section in the Software Requirements Engineering chapter of the |
---|
45 | * RTEMS Software Engineering manual. The manual is provided as a part of |
---|
46 | * a release. For development sources please refer to the online |
---|
47 | * documentation at: |
---|
48 | * |
---|
49 | * https://docs.rtems.org |
---|
50 | */ |
---|
51 | |
---|
52 | /* Generated from spec:/rtems/object/if/header */ |
---|
53 | |
---|
54 | #ifndef _RTEMS_RTEMS_OBJECT_H |
---|
55 | #define _RTEMS_RTEMS_OBJECT_H |
---|
56 | |
---|
57 | #include <stdbool.h> |
---|
58 | #include <stddef.h> |
---|
59 | #include <stdint.h> |
---|
60 | #include <rtems/rtems/status.h> |
---|
61 | #include <rtems/rtems/types.h> |
---|
62 | #include <rtems/score/object.h> |
---|
63 | |
---|
64 | #ifdef __cplusplus |
---|
65 | extern "C" { |
---|
66 | #endif |
---|
67 | |
---|
68 | /* Generated from spec:/rtems/object/if/group */ |
---|
69 | |
---|
70 | /** |
---|
71 | * @defgroup RTEMSAPIClassicObject Object Services |
---|
72 | * |
---|
73 | * @ingroup RTEMSAPIClassic |
---|
74 | * |
---|
75 | * @brief RTEMS provides a collection of services to assist in the management |
---|
76 | * and usage of the objects created and utilized via other managers. These |
---|
77 | * services assist in the manipulation of RTEMS objects independent of the |
---|
78 | * API used to create them. |
---|
79 | */ |
---|
80 | |
---|
81 | /* Generated from spec:/rtems/object/if/api-class-information */ |
---|
82 | |
---|
83 | /** |
---|
84 | * @ingroup RTEMSAPIClassicObject |
---|
85 | * |
---|
86 | * @brief This structure is used to return information to the application about |
---|
87 | * the objects configured for a specific API/Class combination. |
---|
88 | */ |
---|
89 | typedef struct { |
---|
90 | /** |
---|
91 | * @brief This member contains the minimum valid object identifier for this |
---|
92 | * class. |
---|
93 | */ |
---|
94 | rtems_id minimum_id; |
---|
95 | |
---|
96 | /** |
---|
97 | * @brief This member contains the maximum valid object identifier for this |
---|
98 | * class. |
---|
99 | */ |
---|
100 | rtems_id maximum_id; |
---|
101 | |
---|
102 | /** |
---|
103 | * @brief This member contains the maximum number of active objects configured |
---|
104 | * for this class. |
---|
105 | */ |
---|
106 | uint32_t maximum; |
---|
107 | |
---|
108 | /** |
---|
109 | * @brief This member is true, if this class is configured for automatic object |
---|
110 | * extension, otherwise it is false. |
---|
111 | */ |
---|
112 | bool auto_extend; |
---|
113 | |
---|
114 | /** |
---|
115 | * @brief This member contains the number of currently inactive objects of this |
---|
116 | * class. |
---|
117 | */ |
---|
118 | uint32_t unallocated; |
---|
119 | } rtems_object_api_class_information; |
---|
120 | |
---|
121 | /* Generated from spec:/rtems/object/if/id-final */ |
---|
122 | |
---|
123 | /** |
---|
124 | * @ingroup RTEMSAPIClassicObject |
---|
125 | * |
---|
126 | * @brief This constant represents the highest object identifier value. |
---|
127 | */ |
---|
128 | #define RTEMS_OBJECT_ID_FINAL OBJECTS_ID_FINAL |
---|
129 | |
---|
130 | /* Generated from spec:/rtems/object/if/id-final-index */ |
---|
131 | |
---|
132 | /** |
---|
133 | * @ingroup RTEMSAPIClassicObject |
---|
134 | * |
---|
135 | * @brief This constant represents the highest value for the index component of |
---|
136 | * an object identifier. |
---|
137 | */ |
---|
138 | #define RTEMS_OBJECT_ID_FINAL_INDEX OBJECTS_ID_FINAL_INDEX |
---|
139 | |
---|
140 | /* Generated from spec:/rtems/object/if/id-initial */ |
---|
141 | |
---|
142 | /** |
---|
143 | * @ingroup RTEMSAPIClassicObject |
---|
144 | * |
---|
145 | * @brief Builds the object identifier with the lowest index from the API, |
---|
146 | * class, and MPCI node components. |
---|
147 | * |
---|
148 | * @param _api is the API of the object identifier to build. |
---|
149 | * |
---|
150 | * @param _class is the class of the object identifier to build. |
---|
151 | * |
---|
152 | * @param _node is the MPCI node of the object identifier to build. |
---|
153 | * |
---|
154 | * @return Returns the object identifier with the lowest index built from the |
---|
155 | * API, class, and MPCI node components. |
---|
156 | * |
---|
157 | * @par Constraints |
---|
158 | * @parblock |
---|
159 | * The following constraints apply to this directive: |
---|
160 | * |
---|
161 | * * The directive may be called from within any runtime context. |
---|
162 | * |
---|
163 | * * The directive will not cause the calling task to be preempted. |
---|
164 | * @endparblock |
---|
165 | */ |
---|
166 | #define RTEMS_OBJECT_ID_INITIAL( _api, _class, _node ) \ |
---|
167 | OBJECTS_ID_INITIAL( _api, _class, _node ) |
---|
168 | |
---|
169 | /* Generated from spec:/rtems/object/if/id-initial-index */ |
---|
170 | |
---|
171 | /** |
---|
172 | * @ingroup RTEMSAPIClassicObject |
---|
173 | * |
---|
174 | * @brief This constant represents the lowest value for the index component of |
---|
175 | * an object identifier. |
---|
176 | */ |
---|
177 | #define RTEMS_OBJECT_ID_INITIAL_INDEX OBJECTS_ID_INITIAL_INDEX |
---|
178 | |
---|
179 | /* Generated from spec:/rtems/object/if/search-all-nodes */ |
---|
180 | |
---|
181 | /** |
---|
182 | * @ingroup RTEMSAPIClassicObject |
---|
183 | * |
---|
184 | * @brief This constant indicates that an object name to identifier search |
---|
185 | * should search through all MPCI nodes of the system. |
---|
186 | */ |
---|
187 | #define RTEMS_SEARCH_ALL_NODES OBJECTS_SEARCH_ALL_NODES |
---|
188 | |
---|
189 | /* Generated from spec:/rtems/object/if/search-local-node */ |
---|
190 | |
---|
191 | /** |
---|
192 | * @ingroup RTEMSAPIClassicObject |
---|
193 | * |
---|
194 | * @brief This constant indicates that an object name to identifier search |
---|
195 | * should search only the local MPCI node of the system. |
---|
196 | */ |
---|
197 | #define RTEMS_SEARCH_LOCAL_NODE OBJECTS_SEARCH_LOCAL_NODE |
---|
198 | |
---|
199 | /* Generated from spec:/rtems/object/if/search-other-nodes */ |
---|
200 | |
---|
201 | /** |
---|
202 | * @ingroup RTEMSAPIClassicObject |
---|
203 | * |
---|
204 | * @brief This constant indicates that an object name to identifier search |
---|
205 | * should search through all MPCI nodes of the system except the local node. |
---|
206 | */ |
---|
207 | #define RTEMS_SEARCH_OTHER_NODES OBJECTS_SEARCH_OTHER_NODES |
---|
208 | |
---|
209 | /* Generated from spec:/rtems/object/if/who-am-i */ |
---|
210 | |
---|
211 | /** |
---|
212 | * @ingroup RTEMSAPIClassicObject |
---|
213 | * |
---|
214 | * @brief This constant indicates that an object name to identifier search is |
---|
215 | * being asked for the identifier of the currently executing task. |
---|
216 | */ |
---|
217 | #define RTEMS_WHO_AM_I OBJECTS_WHO_AM_I |
---|
218 | |
---|
219 | /* Generated from spec:/rtems/object/if/build-id */ |
---|
220 | |
---|
221 | /** |
---|
222 | * @ingroup RTEMSAPIClassicObject |
---|
223 | * |
---|
224 | * @brief Builds the object identifier from the API, class, MPCI node, and |
---|
225 | * index components. |
---|
226 | * |
---|
227 | * @param api is the API of the object identifier to build. |
---|
228 | * |
---|
229 | * @param the_class is the class of the object identifier to build. |
---|
230 | * |
---|
231 | * @param node is the MPCI node of the object identifier to build. |
---|
232 | * |
---|
233 | * @param index is the index of the object identifier to build. |
---|
234 | * |
---|
235 | * @return Returns the object identifier built from the API, class, MPCI node, |
---|
236 | * and index components. |
---|
237 | * |
---|
238 | * @par Constraints |
---|
239 | * @parblock |
---|
240 | * The following constraints apply to this directive: |
---|
241 | * |
---|
242 | * * The directive is implemented by a macro and may be called from within |
---|
243 | * C/C++ constant expressions. In addition, a function implementation of the |
---|
244 | * directive exists for bindings to other programming languages. |
---|
245 | * |
---|
246 | * * The directive will not cause the calling task to be preempted. |
---|
247 | * @endparblock |
---|
248 | */ |
---|
249 | rtems_id rtems_build_id( |
---|
250 | uint32_t api, |
---|
251 | uint32_t the_class, |
---|
252 | uint32_t node, |
---|
253 | uint32_t index |
---|
254 | ); |
---|
255 | |
---|
256 | /* Generated from spec:/rtems/object/if/build-id-macro */ |
---|
257 | #define rtems_build_id( _api, _class, _node, _index ) \ |
---|
258 | _Objects_Build_id( _api, _class, _node, _index ) |
---|
259 | |
---|
260 | /* Generated from spec:/rtems/object/if/build-name */ |
---|
261 | |
---|
262 | /** |
---|
263 | * @ingroup RTEMSAPIClassicObject |
---|
264 | * |
---|
265 | * @brief Builds the object name composed of the four characters. |
---|
266 | * |
---|
267 | * @param c1 is the first character of the name. |
---|
268 | * |
---|
269 | * @param c2 is the second character of the name. |
---|
270 | * |
---|
271 | * @param c3 is the third character of the name. |
---|
272 | * |
---|
273 | * @param c4 is the fourth character of the name. |
---|
274 | * |
---|
275 | * This directive takes the four characters provided as arguments and composes |
---|
276 | * a 32-bit object name with ``c1`` in the most significant 8-bits and ``c4`` |
---|
277 | * in the least significant 8-bits. |
---|
278 | * |
---|
279 | * @return Returns the object name composed of the four characters. |
---|
280 | * |
---|
281 | * @par Constraints |
---|
282 | * @parblock |
---|
283 | * The following constraints apply to this directive: |
---|
284 | * |
---|
285 | * * The directive is implemented by a macro and may be called from within |
---|
286 | * C/C++ constant expressions. In addition, a function implementation of the |
---|
287 | * directive exists for bindings to other programming languages. |
---|
288 | * |
---|
289 | * * The directive will not cause the calling task to be preempted. |
---|
290 | * @endparblock |
---|
291 | */ |
---|
292 | rtems_name rtems_build_name( char c1, char c2, char c3, char c4 ); |
---|
293 | |
---|
294 | /* Generated from spec:/rtems/object/if/build-name-macro */ |
---|
295 | #define rtems_build_name( _c1, _c2, _c3, _c4 ) \ |
---|
296 | _Objects_Build_name( _c1, _c2, _c3, _c4 ) |
---|
297 | |
---|
298 | /* Generated from spec:/rtems/object/if/get-classic-name */ |
---|
299 | |
---|
300 | /** |
---|
301 | * @ingroup RTEMSAPIClassicObject |
---|
302 | * |
---|
303 | * @brief Gets the object name associated with the object identifier. |
---|
304 | * |
---|
305 | * @param id is the object identifier to get the name. |
---|
306 | * |
---|
307 | * @param[out] name is the pointer to an ::rtems_name object. When the |
---|
308 | * directive call is successful, the object name associated with the object |
---|
309 | * identifier will be stored in this object. |
---|
310 | * |
---|
311 | * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. |
---|
312 | * |
---|
313 | * @retval ::RTEMS_INVALID_ADDRESS The ``name`` parameter was NULL. |
---|
314 | * |
---|
315 | * @retval ::RTEMS_INVALID_ID There was no object information available for the |
---|
316 | * object identifier. |
---|
317 | * |
---|
318 | * @retval ::RTEMS_INVALID_ID The object name associated with the object |
---|
319 | * identifier was a string. |
---|
320 | * |
---|
321 | * @retval ::RTEMS_INVALID_ID There was no object associated with the object |
---|
322 | * identifier. |
---|
323 | * |
---|
324 | * @par Constraints |
---|
325 | * @parblock |
---|
326 | * The following constraints apply to this directive: |
---|
327 | * |
---|
328 | * * The directive may be called from within any runtime context. |
---|
329 | * |
---|
330 | * * The directive will not cause the calling task to be preempted. |
---|
331 | * @endparblock |
---|
332 | */ |
---|
333 | rtems_status_code rtems_object_get_classic_name( |
---|
334 | rtems_id id, |
---|
335 | rtems_name *name |
---|
336 | ); |
---|
337 | |
---|
338 | /* Generated from spec:/rtems/object/if/get-name */ |
---|
339 | |
---|
340 | /** |
---|
341 | * @ingroup RTEMSAPIClassicObject |
---|
342 | * |
---|
343 | * @brief Gets the object name associated with the object identifier as a |
---|
344 | * string. |
---|
345 | * |
---|
346 | * @param id is the object identifier to get the name. |
---|
347 | * |
---|
348 | * @param length is the buffer length in bytes. |
---|
349 | * |
---|
350 | * @param[out] name is the pointer to a buffer of the specified length. |
---|
351 | * |
---|
352 | * The object name is stored in the name buffer. If the name buffer length is |
---|
353 | * greater than zero, then the stored object name will be ``NUL`` terminated. |
---|
354 | * The stored object name may be truncated to fit the length. There is no |
---|
355 | * indication if a truncation occurred. Every attempt is made to return name |
---|
356 | * as a printable string even if the object has the Classic API 32-bit integer |
---|
357 | * style name. |
---|
358 | * |
---|
359 | * @retval NULL The ``length`` parameter was 0. |
---|
360 | * |
---|
361 | * @retval NULL The ``name`` parameter was NULL. |
---|
362 | * |
---|
363 | * @retval NULL There was no object information available for the object |
---|
364 | * identifier. |
---|
365 | * |
---|
366 | * @retval NULL There was no object associated with the object identifier. |
---|
367 | * |
---|
368 | * @return Returns the ``name`` parameter value, if there is an object name |
---|
369 | * associated with the object identifier. |
---|
370 | * |
---|
371 | * @par Constraints |
---|
372 | * @parblock |
---|
373 | * The following constraints apply to this directive: |
---|
374 | * |
---|
375 | * * The directive may be called from within any runtime context. |
---|
376 | * |
---|
377 | * * The directive will not cause the calling task to be preempted. |
---|
378 | * @endparblock |
---|
379 | */ |
---|
380 | char *rtems_object_get_name( rtems_id id, size_t length, char *name ); |
---|
381 | |
---|
382 | /* Generated from spec:/rtems/object/if/set-name */ |
---|
383 | |
---|
384 | /** |
---|
385 | * @ingroup RTEMSAPIClassicObject |
---|
386 | * |
---|
387 | * @brief Sets the object name of the object associated with the object |
---|
388 | * identifier. |
---|
389 | * |
---|
390 | * @param id is the object identifier of the object to set the name. |
---|
391 | * |
---|
392 | * @param name is the object name to set. |
---|
393 | * |
---|
394 | * This directive will set the object name based upon the user string. |
---|
395 | * |
---|
396 | * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. |
---|
397 | * |
---|
398 | * @retval ::RTEMS_INVALID_ADDRESS The ``name`` parameter was NULL. |
---|
399 | * |
---|
400 | * @retval ::RTEMS_INVALID_ID There was no object information available for the |
---|
401 | * object identifier. |
---|
402 | * |
---|
403 | * @retval ::RTEMS_INVALID_ID There was no object associated with the object |
---|
404 | * identifier. |
---|
405 | * |
---|
406 | * @retval ::RTEMS_NO_MEMORY There was no memory available to duplicate the |
---|
407 | * name. |
---|
408 | * |
---|
409 | * @par Notes |
---|
410 | * @parblock |
---|
411 | * This directive can be used to set the name of objects which do not have a |
---|
412 | * naming scheme per their API. |
---|
413 | * |
---|
414 | * If the object specified by ``id`` is of a class that has a string name, this |
---|
415 | * directive will free the existing name to the RTEMS Workspace and allocate |
---|
416 | * enough memory from the RTEMS Workspace to make a copy of the string located |
---|
417 | * at ``name``. |
---|
418 | * |
---|
419 | * If the object specified by ``id`` is of a class that has a 32-bit integer |
---|
420 | * style name, then the first four characters in ``name`` will be used to |
---|
421 | * construct the name. |
---|
422 | * @endparblock |
---|
423 | * |
---|
424 | * @par Constraints |
---|
425 | * @parblock |
---|
426 | * The following constraints apply to this directive: |
---|
427 | * |
---|
428 | * * The directive may be called from within device driver initialization |
---|
429 | * context. |
---|
430 | * |
---|
431 | * * The directive may be called from within task context. |
---|
432 | * |
---|
433 | * * The directive may obtain and release the object allocator mutex. This may |
---|
434 | * cause the calling task to be preempted. |
---|
435 | * @endparblock |
---|
436 | */ |
---|
437 | rtems_status_code rtems_object_set_name( rtems_id id, const char *name ); |
---|
438 | |
---|
439 | /* Generated from spec:/rtems/object/if/id-get-api */ |
---|
440 | |
---|
441 | /** |
---|
442 | * @ingroup RTEMSAPIClassicObject |
---|
443 | * |
---|
444 | * @brief Gets the API component of the object identifier. |
---|
445 | * |
---|
446 | * @param id is the object identifier with the API component to get. |
---|
447 | * |
---|
448 | * @return Returns the API component of the object identifier. |
---|
449 | * |
---|
450 | * @par Notes |
---|
451 | * This directive does not validate the object identifier provided in ``id``. |
---|
452 | * |
---|
453 | * @par Constraints |
---|
454 | * @parblock |
---|
455 | * The following constraints apply to this directive: |
---|
456 | * |
---|
457 | * * The directive is implemented by a macro and may be called from within |
---|
458 | * C/C++ constant expressions. In addition, a function implementation of the |
---|
459 | * directive exists for bindings to other programming languages. |
---|
460 | * |
---|
461 | * * The directive will not cause the calling task to be preempted. |
---|
462 | * @endparblock |
---|
463 | */ |
---|
464 | int rtems_object_id_get_api( rtems_id id ); |
---|
465 | |
---|
466 | /* Generated from spec:/rtems/object/if/id-get-api-macro */ |
---|
467 | #define rtems_object_id_get_api( _id ) _Objects_Get_API( _id ) |
---|
468 | |
---|
469 | /* Generated from spec:/rtems/object/if/id-get-class */ |
---|
470 | |
---|
471 | /** |
---|
472 | * @ingroup RTEMSAPIClassicObject |
---|
473 | * |
---|
474 | * @brief Gets the class component of the object identifier. |
---|
475 | * |
---|
476 | * @param id is the object identifier with the class component to get. |
---|
477 | * |
---|
478 | * @return Returns the class component of the object identifier. |
---|
479 | * |
---|
480 | * @par Notes |
---|
481 | * This directive does not validate the object identifier provided in ``id``. |
---|
482 | * |
---|
483 | * @par Constraints |
---|
484 | * @parblock |
---|
485 | * The following constraints apply to this directive: |
---|
486 | * |
---|
487 | * * The directive is implemented by a macro and may be called from within |
---|
488 | * C/C++ constant expressions. In addition, a function implementation of the |
---|
489 | * directive exists for bindings to other programming languages. |
---|
490 | * |
---|
491 | * * The directive will not cause the calling task to be preempted. |
---|
492 | * @endparblock |
---|
493 | */ |
---|
494 | int rtems_object_id_get_class( rtems_id id ); |
---|
495 | |
---|
496 | /* Generated from spec:/rtems/object/if/id-get-class-macro */ |
---|
497 | #define rtems_object_id_get_class( _id ) _Objects_Get_class( _id ) |
---|
498 | |
---|
499 | /* Generated from spec:/rtems/object/if/id-get-node */ |
---|
500 | |
---|
501 | /** |
---|
502 | * @ingroup RTEMSAPIClassicObject |
---|
503 | * |
---|
504 | * @brief Gets the MPCI node component of the object identifier. |
---|
505 | * |
---|
506 | * @param id is the object identifier with the MPCI node component to get. |
---|
507 | * |
---|
508 | * @return Returns the MPCI node component of the object identifier. |
---|
509 | * |
---|
510 | * @par Notes |
---|
511 | * This directive does not validate the object identifier provided in ``id``. |
---|
512 | * |
---|
513 | * @par Constraints |
---|
514 | * @parblock |
---|
515 | * The following constraints apply to this directive: |
---|
516 | * |
---|
517 | * * The directive is implemented by a macro and may be called from within |
---|
518 | * C/C++ constant expressions. In addition, a function implementation of the |
---|
519 | * directive exists for bindings to other programming languages. |
---|
520 | * |
---|
521 | * * The directive will not cause the calling task to be preempted. |
---|
522 | * @endparblock |
---|
523 | */ |
---|
524 | int rtems_object_id_get_node( rtems_id id ); |
---|
525 | |
---|
526 | /* Generated from spec:/rtems/object/if/id-get-node-macro */ |
---|
527 | #define rtems_object_id_get_node( _id ) _Objects_Get_node( _id ) |
---|
528 | |
---|
529 | /* Generated from spec:/rtems/object/if/id-get-index */ |
---|
530 | |
---|
531 | /** |
---|
532 | * @ingroup RTEMSAPIClassicObject |
---|
533 | * |
---|
534 | * @brief Gets the index component of the object identifier. |
---|
535 | * |
---|
536 | * @param id is the object identifier with the index component to get. |
---|
537 | * |
---|
538 | * @return Returns the index component of the object identifier. |
---|
539 | * |
---|
540 | * @par Notes |
---|
541 | * This directive does not validate the object identifier provided in ``id``. |
---|
542 | * |
---|
543 | * @par Constraints |
---|
544 | * @parblock |
---|
545 | * The following constraints apply to this directive: |
---|
546 | * |
---|
547 | * * The directive is implemented by a macro and may be called from within |
---|
548 | * C/C++ constant expressions. In addition, a function implementation of the |
---|
549 | * directive exists for bindings to other programming languages. |
---|
550 | * |
---|
551 | * * The directive will not cause the calling task to be preempted. |
---|
552 | * @endparblock |
---|
553 | */ |
---|
554 | int rtems_object_id_get_index( rtems_id id ); |
---|
555 | |
---|
556 | /* Generated from spec:/rtems/object/if/id-get-index-macro */ |
---|
557 | #define rtems_object_id_get_index( _id ) _Objects_Get_index( _id ) |
---|
558 | |
---|
559 | /* Generated from spec:/rtems/object/if/id-api-minimum */ |
---|
560 | |
---|
561 | /** |
---|
562 | * @ingroup RTEMSAPIClassicObject |
---|
563 | * |
---|
564 | * @brief Gets the lowest valid value for the API component of an object |
---|
565 | * identifier. |
---|
566 | * |
---|
567 | * @return Returns the lowest valid value for the API component of an object |
---|
568 | * identifier. |
---|
569 | * |
---|
570 | * @par Constraints |
---|
571 | * @parblock |
---|
572 | * The following constraints apply to this directive: |
---|
573 | * |
---|
574 | * * The directive is implemented by a macro and may be called from within |
---|
575 | * C/C++ constant expressions. In addition, a function implementation of the |
---|
576 | * directive exists for bindings to other programming languages. |
---|
577 | * |
---|
578 | * * The directive will not cause the calling task to be preempted. |
---|
579 | * @endparblock |
---|
580 | */ |
---|
581 | int rtems_object_id_api_minimum( void ); |
---|
582 | |
---|
583 | /* Generated from spec:/rtems/object/if/id-api-minimum-macro */ |
---|
584 | #define rtems_object_id_api_minimum() OBJECTS_INTERNAL_API |
---|
585 | |
---|
586 | /* Generated from spec:/rtems/object/if/id-api-maximum */ |
---|
587 | |
---|
588 | /** |
---|
589 | * @ingroup RTEMSAPIClassicObject |
---|
590 | * |
---|
591 | * @brief Gets the highest valid value for the API component of an object |
---|
592 | * identifier. |
---|
593 | * |
---|
594 | * @return Returns the highest valid value for the API component of an object |
---|
595 | * identifier. |
---|
596 | * |
---|
597 | * @par Constraints |
---|
598 | * @parblock |
---|
599 | * The following constraints apply to this directive: |
---|
600 | * |
---|
601 | * * The directive is implemented by a macro and may be called from within |
---|
602 | * C/C++ constant expressions. In addition, a function implementation of the |
---|
603 | * directive exists for bindings to other programming languages. |
---|
604 | * |
---|
605 | * * The directive will not cause the calling task to be preempted. |
---|
606 | * @endparblock |
---|
607 | */ |
---|
608 | int rtems_object_id_api_maximum( void ); |
---|
609 | |
---|
610 | /* Generated from spec:/rtems/object/if/id-api-maximum-macro */ |
---|
611 | #define rtems_object_id_api_maximum() OBJECTS_APIS_LAST |
---|
612 | |
---|
613 | /* Generated from spec:/rtems/object/if/api-minimum-class */ |
---|
614 | |
---|
615 | /** |
---|
616 | * @ingroup RTEMSAPIClassicObject |
---|
617 | * |
---|
618 | * @brief Gets the lowest valid class value of the object API. |
---|
619 | * |
---|
620 | * @param api is the object API to get the lowest valid class value. |
---|
621 | * |
---|
622 | * @retval -1 The object API was invalid. |
---|
623 | * |
---|
624 | * @return Returns the lowest valid class value of the object API. |
---|
625 | * |
---|
626 | * @par Constraints |
---|
627 | * @parblock |
---|
628 | * The following constraints apply to this directive: |
---|
629 | * |
---|
630 | * * The directive may be called from within any runtime context. |
---|
631 | * |
---|
632 | * * The directive will not cause the calling task to be preempted. |
---|
633 | * @endparblock |
---|
634 | */ |
---|
635 | int rtems_object_api_minimum_class( int api ); |
---|
636 | |
---|
637 | /* Generated from spec:/rtems/object/if/api-maximum-class */ |
---|
638 | |
---|
639 | /** |
---|
640 | * @ingroup RTEMSAPIClassicObject |
---|
641 | * |
---|
642 | * @brief Gets the highest valid class value of the object API. |
---|
643 | * |
---|
644 | * @param api is the object API to get the highest valid class value. |
---|
645 | * |
---|
646 | * @retval 0 The object API was invalid. |
---|
647 | * |
---|
648 | * @return Returns the highest valid class value of the object API. |
---|
649 | * |
---|
650 | * @par Constraints |
---|
651 | * @parblock |
---|
652 | * The following constraints apply to this directive: |
---|
653 | * |
---|
654 | * * The directive may be called from within any runtime context. |
---|
655 | * |
---|
656 | * * The directive will not cause the calling task to be preempted. |
---|
657 | * @endparblock |
---|
658 | */ |
---|
659 | int rtems_object_api_maximum_class( int api ); |
---|
660 | |
---|
661 | /* Generated from spec:/rtems/object/if/get-api-name */ |
---|
662 | |
---|
663 | /** |
---|
664 | * @ingroup RTEMSAPIClassicObject |
---|
665 | * |
---|
666 | * @brief Gets a descriptive name of the object API. |
---|
667 | * |
---|
668 | * @param api is the object API to get the name. |
---|
669 | * |
---|
670 | * @retval "BAD API" The API was invalid. |
---|
671 | * |
---|
672 | * @return Returns a descriptive name of the API, if the API was valid. |
---|
673 | * |
---|
674 | * @par Notes |
---|
675 | * The string returned is from constant space. Do not modify or free it. |
---|
676 | * |
---|
677 | * @par Constraints |
---|
678 | * @parblock |
---|
679 | * The following constraints apply to this directive: |
---|
680 | * |
---|
681 | * * The directive may be called from within any runtime context. |
---|
682 | * |
---|
683 | * * The directive will not cause the calling task to be preempted. |
---|
684 | * @endparblock |
---|
685 | */ |
---|
686 | const char *rtems_object_get_api_name( int api ); |
---|
687 | |
---|
688 | /* Generated from spec:/rtems/object/if/get-api-class-name */ |
---|
689 | |
---|
690 | /** |
---|
691 | * @ingroup RTEMSAPIClassicObject |
---|
692 | * |
---|
693 | * @brief Gets a descriptive name of the object class of the object API. |
---|
694 | * |
---|
695 | * @param the_api is the object API of the object class. |
---|
696 | * |
---|
697 | * @param the_class is the object class of the object API to get the name. |
---|
698 | * |
---|
699 | * @retval "BAD API" The API was invalid. |
---|
700 | * |
---|
701 | * @retval "BAD CLASS" The class of the API was invalid. |
---|
702 | * |
---|
703 | * @return Returns a descriptive name of the class of the API, if the class of |
---|
704 | * the API and the API were valid. |
---|
705 | * |
---|
706 | * @par Notes |
---|
707 | * The string returned is from constant space. Do not modify or free it. |
---|
708 | * |
---|
709 | * @par Constraints |
---|
710 | * @parblock |
---|
711 | * The following constraints apply to this directive: |
---|
712 | * |
---|
713 | * * The directive may be called from within any runtime context. |
---|
714 | * |
---|
715 | * * The directive will not cause the calling task to be preempted. |
---|
716 | * @endparblock |
---|
717 | */ |
---|
718 | const char *rtems_object_get_api_class_name( int the_api, int the_class ); |
---|
719 | |
---|
720 | /* Generated from spec:/rtems/object/if/get-class-information */ |
---|
721 | |
---|
722 | /** |
---|
723 | * @ingroup RTEMSAPIClassicObject |
---|
724 | * |
---|
725 | * @brief Gets the object class information of the object class of the object |
---|
726 | * API. |
---|
727 | * |
---|
728 | * @param the_api is the object API of the object class. |
---|
729 | * |
---|
730 | * @param the_class is the object class of the object API to get the class |
---|
731 | * information. |
---|
732 | * |
---|
733 | * @param[out] info is the pointer to an rtems_object_api_class_information |
---|
734 | * object. When the directive call is successful, the object class |
---|
735 | * information of the class of the API will be stored in this object. |
---|
736 | * |
---|
737 | * @retval ::RTEMS_SUCCESSFUL The requested operation was successful. |
---|
738 | * |
---|
739 | * @retval ::RTEMS_INVALID_ADDRESS The ``info`` parameter was NULL. |
---|
740 | * |
---|
741 | * @retval ::RTEMS_INVALID_NUMBER The class of the API or the API was invalid. |
---|
742 | * |
---|
743 | * @par Constraints |
---|
744 | * @parblock |
---|
745 | * The following constraints apply to this directive: |
---|
746 | * |
---|
747 | * * The directive may be called from within any runtime context. |
---|
748 | * |
---|
749 | * * The directive will not cause the calling task to be preempted. |
---|
750 | * @endparblock |
---|
751 | */ |
---|
752 | rtems_status_code rtems_object_get_class_information( |
---|
753 | int the_api, |
---|
754 | int the_class, |
---|
755 | rtems_object_api_class_information *info |
---|
756 | ); |
---|
757 | |
---|
758 | /* Generated from spec:/rtems/object/if/get-local-node */ |
---|
759 | |
---|
760 | /** |
---|
761 | * @ingroup RTEMSAPIClassicObject |
---|
762 | * |
---|
763 | * @brief Gets the local MPCI node number. |
---|
764 | * |
---|
765 | * @return Returns the local MPCI node number. |
---|
766 | * |
---|
767 | * @par Constraints |
---|
768 | * @parblock |
---|
769 | * The following constraints apply to this directive: |
---|
770 | * |
---|
771 | * * The directive may be called from within any runtime context. |
---|
772 | * |
---|
773 | * * The directive will not cause the calling task to be preempted. |
---|
774 | * @endparblock |
---|
775 | */ |
---|
776 | static inline uint16_t rtems_object_get_local_node( void ) |
---|
777 | { |
---|
778 | return _Objects_Local_node; |
---|
779 | } |
---|
780 | |
---|
781 | #ifdef __cplusplus |
---|
782 | } |
---|
783 | #endif |
---|
784 | |
---|
785 | #endif /* _RTEMS_RTEMS_OBJECT_H */ |
---|