1 | .. comment SPDX-License-Identifier: CC-BY-SA-4.0 |
---|
2 | |
---|
3 | .. COMMENT: COPYRIGHT (c) 1988-2008. |
---|
4 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
5 | .. COMMENT: All rights reserved. |
---|
6 | |
---|
7 | Object Services |
---|
8 | ############### |
---|
9 | |
---|
10 | .. index:: object manipulation |
---|
11 | |
---|
12 | Introduction |
---|
13 | ============ |
---|
14 | |
---|
15 | RTEMS provides a collection of services to assist in the management and usage |
---|
16 | of the objects created and utilized via other managers. These services assist |
---|
17 | in the manipulation of RTEMS objects independent of the API used to create |
---|
18 | them. The object related services provided by RTEMS are: |
---|
19 | |
---|
20 | - build_id |
---|
21 | |
---|
22 | - rtems_build_name_ - build object name from characters |
---|
23 | |
---|
24 | - rtems_object_get_classic_name_ - lookup name from Id |
---|
25 | |
---|
26 | - rtems_object_get_name_ - obtain object name as string |
---|
27 | |
---|
28 | - rtems_object_set_name_ - set object name |
---|
29 | |
---|
30 | - rtems_object_id_get_api_ - obtain API from Id |
---|
31 | |
---|
32 | - rtems_object_id_get_class_ - obtain class from Id |
---|
33 | |
---|
34 | - rtems_object_id_get_node_ - obtain node from Id |
---|
35 | |
---|
36 | - rtems_object_id_get_index_ - obtain index from Id |
---|
37 | |
---|
38 | - rtems_build_id_ - build object id from components |
---|
39 | |
---|
40 | - rtems_object_id_api_minimum_ - obtain minimum API value |
---|
41 | |
---|
42 | - rtems_object_id_api_maximum_ - obtain maximum API value |
---|
43 | |
---|
44 | - rtems_object_id_api_minimum_class_ - obtain minimum class value |
---|
45 | |
---|
46 | - rtems_object_id_api_maximum_class_ - obtain maximum class value |
---|
47 | |
---|
48 | - rtems_object_get_api_name_ - obtain API name |
---|
49 | |
---|
50 | - rtems_object_get_api_class_name_ - obtain class name |
---|
51 | |
---|
52 | - rtems_object_get_class_information_ - obtain class information |
---|
53 | |
---|
54 | Background |
---|
55 | ========== |
---|
56 | |
---|
57 | APIs |
---|
58 | ---- |
---|
59 | |
---|
60 | RTEMS implements multiple APIs including an Internal API, the Classic API, and |
---|
61 | the POSIX API. These APIs share the common foundation of SuperCore objects and |
---|
62 | thus share object management code. This includes a common scheme for object Ids |
---|
63 | and for managing object names whether those names be in the thirty-two bit form |
---|
64 | used by the Classic API or C strings. |
---|
65 | |
---|
66 | The object Id contains a field indicating the API that an object instance is |
---|
67 | associated with. This field holds a numerically small non-zero integer. |
---|
68 | |
---|
69 | Object Classes |
---|
70 | -------------- |
---|
71 | |
---|
72 | Each API consists of a collection of managers. Each manager is responsible for |
---|
73 | instances of a particular object class. Classic API Tasks and POSIX Mutexes |
---|
74 | example classes. |
---|
75 | |
---|
76 | The object Id contains a field indicating the class that an object instance is |
---|
77 | associated with. This field holds a numerically small non-zero integer. In |
---|
78 | all APIs, a class value of one is reserved for tasks or threads. |
---|
79 | |
---|
80 | Object Names |
---|
81 | ------------ |
---|
82 | |
---|
83 | Every RTEMS object which has an Id may also have a name associated with it. |
---|
84 | Depending on the API, names may be either thirty-two bit integers as in the |
---|
85 | Classic API or strings as in the POSIX API. |
---|
86 | |
---|
87 | Some objects have Ids but do not have a defined way to associate a name with |
---|
88 | them. For example, POSIX threads have Ids but per POSIX do not have names. In |
---|
89 | RTEMS, objects not defined to have thirty-two bit names may have string names |
---|
90 | assigned to them via the ``rtems_object_set_name`` service. The original |
---|
91 | impetus in providing this service was so the normally anonymous POSIX threads |
---|
92 | could have a user defined name in CPU Usage Reports. |
---|
93 | |
---|
94 | Operations |
---|
95 | ========== |
---|
96 | |
---|
97 | Decomposing and Recomposing an Object Id |
---|
98 | ---------------------------------------- |
---|
99 | |
---|
100 | Services are provided to decompose an object Id into its subordinate |
---|
101 | components. The following services are used to do this: |
---|
102 | |
---|
103 | - ``rtems_object_id_get_api`` |
---|
104 | |
---|
105 | - ``rtems_object_id_get_class`` |
---|
106 | |
---|
107 | - ``rtems_object_id_get_node`` |
---|
108 | |
---|
109 | - ``rtems_object_id_get_index`` |
---|
110 | |
---|
111 | The following C language example illustrates the decomposition of an Id and |
---|
112 | printing the values. |
---|
113 | |
---|
114 | .. code-block:: c |
---|
115 | |
---|
116 | void printObjectId(rtems_id id) |
---|
117 | { |
---|
118 | printf( |
---|
119 | "API=%d Class=%d Node=%d Index=%d\n", |
---|
120 | rtems_object_id_get_api(id), |
---|
121 | rtems_object_id_get_class(id), |
---|
122 | rtems_object_id_get_node(id), |
---|
123 | rtems_object_id_get_index(id) |
---|
124 | ); |
---|
125 | } |
---|
126 | |
---|
127 | This prints the components of the Ids as integers. |
---|
128 | |
---|
129 | It is also possible to construct an arbitrary Id using the ``rtems_build_id`` |
---|
130 | service. The following C language example illustrates how to construct the |
---|
131 | "next Id." |
---|
132 | |
---|
133 | .. code-block:: c |
---|
134 | |
---|
135 | rtems_id nextObjectId(rtems_id id) |
---|
136 | { |
---|
137 | return rtems_build_id( |
---|
138 | rtems_object_id_get_api(id), |
---|
139 | rtems_object_id_get_class(id), |
---|
140 | rtems_object_id_get_node(id), |
---|
141 | rtems_object_id_get_index(id) + 1 |
---|
142 | ); |
---|
143 | } |
---|
144 | |
---|
145 | Note that this Id may not be valid in this |
---|
146 | system or associated with an allocated object. |
---|
147 | |
---|
148 | Printing an Object Id |
---|
149 | --------------------- |
---|
150 | |
---|
151 | RTEMS also provides services to associate the API and Class portions of an |
---|
152 | Object Id with strings. This allows the application developer to provide more |
---|
153 | information about an object in diagnostic messages. |
---|
154 | |
---|
155 | In the following C language example, an Id is decomposed into its constituent |
---|
156 | parts and "pretty-printed." |
---|
157 | |
---|
158 | .. code-block:: c |
---|
159 | |
---|
160 | void prettyPrintObjectId(rtems_id id) |
---|
161 | { |
---|
162 | int tmpAPI, tmpClass; |
---|
163 | |
---|
164 | tmpAPI = rtems_object_id_get_api(id), |
---|
165 | tmpClass = rtems_object_id_get_class(id), |
---|
166 | |
---|
167 | printf( |
---|
168 | "API=%s Class=%s Node=%d Index=%d\n", |
---|
169 | rtems_object_get_api_name(tmpAPI), |
---|
170 | rtems_object_get_api_class_name(tmpAPI, tmpClass), |
---|
171 | rtems_object_id_get_node(id), |
---|
172 | rtems_object_id_get_index(id) |
---|
173 | ); |
---|
174 | } |
---|
175 | |
---|
176 | Directives |
---|
177 | ========== |
---|
178 | |
---|
179 | .. _rtems_build_name: |
---|
180 | |
---|
181 | BUILD_NAME - Build object name from characters |
---|
182 | ---------------------------------------------- |
---|
183 | .. index:: build object name |
---|
184 | |
---|
185 | **CALLING SEQUENCE:** |
---|
186 | |
---|
187 | .. index:: rtems_build_name |
---|
188 | |
---|
189 | .. code-block:: c |
---|
190 | |
---|
191 | rtems_name rtems_build_name( |
---|
192 | uint8_t c1, |
---|
193 | uint8_t c2, |
---|
194 | uint8_t c3, |
---|
195 | uint8_t c4 |
---|
196 | ); |
---|
197 | |
---|
198 | **DIRECTIVE STATUS CODES** |
---|
199 | |
---|
200 | Returns a name constructed from the four characters. |
---|
201 | |
---|
202 | **DESCRIPTION:** |
---|
203 | |
---|
204 | This service takes the four characters provided as arguments and constructs a |
---|
205 | thirty-two bit object name with ``c1`` in the most significant byte and ``c4`` |
---|
206 | in the least significant byte. |
---|
207 | |
---|
208 | **NOTES:** |
---|
209 | |
---|
210 | This directive is strictly local and does not impact task scheduling. |
---|
211 | |
---|
212 | .. _rtems_object_get_classic_name: |
---|
213 | |
---|
214 | OBJECT_GET_CLASSIC_NAME - Lookup name from id |
---|
215 | --------------------------------------------- |
---|
216 | .. index:: get name from id |
---|
217 | .. index:: obtain name from id |
---|
218 | |
---|
219 | **CALLING SEQUENCE:** |
---|
220 | |
---|
221 | .. index:: rtems_object_get_classic_name |
---|
222 | |
---|
223 | .. code-block:: c |
---|
224 | |
---|
225 | rtems_status_code rtems_object_get_classic_name( |
---|
226 | rtems_id id, |
---|
227 | rtems_name *name |
---|
228 | ); |
---|
229 | |
---|
230 | **DIRECTIVE STATUS CODES** |
---|
231 | |
---|
232 | .. list-table:: |
---|
233 | :class: rtems-table |
---|
234 | |
---|
235 | * - ``RTEMS_SUCCESSFUL`` |
---|
236 | - name looked up successfully |
---|
237 | * - ``RTEMS_INVALID_ADDRESS`` |
---|
238 | - invalid name pointer |
---|
239 | * - ``RTEMS_INVALID_ID`` |
---|
240 | - invalid object id |
---|
241 | |
---|
242 | **DESCRIPTION:** |
---|
243 | |
---|
244 | This service looks up the name for the object ``id`` specified and, if found, |
---|
245 | places the result in ``*name``. |
---|
246 | |
---|
247 | **NOTES:** |
---|
248 | |
---|
249 | This directive is strictly local and does not impact task scheduling. |
---|
250 | |
---|
251 | .. _rtems_object_get_name: |
---|
252 | |
---|
253 | OBJECT_GET_NAME - Obtain object name as string |
---|
254 | ---------------------------------------------- |
---|
255 | .. index:: get object name as string |
---|
256 | .. index:: obtain object name as string |
---|
257 | |
---|
258 | **CALLING SEQUENCE:** |
---|
259 | |
---|
260 | .. index:: rtems_object_get_name |
---|
261 | |
---|
262 | .. code-block:: c |
---|
263 | |
---|
264 | char* rtems_object_get_name( |
---|
265 | rtems_id id, |
---|
266 | size_t length, |
---|
267 | char *name |
---|
268 | ); |
---|
269 | |
---|
270 | **DIRECTIVE STATUS CODES** |
---|
271 | |
---|
272 | Returns a pointer to the name if successful or ``NULL`` otherwise. |
---|
273 | |
---|
274 | **DESCRIPTION:** |
---|
275 | |
---|
276 | This service looks up the name of the object specified by ``id`` and places it |
---|
277 | in the memory pointed to by ``name``. Every attempt is made to return name as |
---|
278 | a printable string even if the object has the Classic API thirty-two bit style |
---|
279 | name. |
---|
280 | |
---|
281 | **NOTES:** |
---|
282 | |
---|
283 | This directive is strictly local and does not impact task scheduling. |
---|
284 | |
---|
285 | .. _rtems_object_set_name: |
---|
286 | |
---|
287 | OBJECT_SET_NAME - Set object name |
---|
288 | --------------------------------- |
---|
289 | .. index:: set object name |
---|
290 | |
---|
291 | **CALLING SEQUENCE:** |
---|
292 | |
---|
293 | .. index:: rtems_object_set_name |
---|
294 | |
---|
295 | .. code-block:: c |
---|
296 | |
---|
297 | rtems_status_code rtems_object_set_name( |
---|
298 | rtems_id id, |
---|
299 | const char *name |
---|
300 | ); |
---|
301 | |
---|
302 | **DIRECTIVE STATUS CODES** |
---|
303 | |
---|
304 | .. list-table:: |
---|
305 | :class: rtems-table |
---|
306 | |
---|
307 | * - ``RTEMS_SUCCESSFUL`` |
---|
308 | - name looked up successfully |
---|
309 | * - ``RTEMS_INVALID_ADDRESS`` |
---|
310 | - invalid name pointer |
---|
311 | * - ``RTEMS_INVALID_ID`` |
---|
312 | - invalid object id |
---|
313 | |
---|
314 | **DESCRIPTION:** |
---|
315 | |
---|
316 | This service sets the name of ``id`` to that specified by the string located at |
---|
317 | ``name``. |
---|
318 | |
---|
319 | **NOTES:** |
---|
320 | |
---|
321 | This directive is strictly local and does not impact task scheduling. |
---|
322 | |
---|
323 | If the object specified by ``id`` is of a class that has a string name, this |
---|
324 | method will free the existing name to the RTEMS Workspace and allocate enough |
---|
325 | memory from the RTEMS Workspace to make a copy of the string located at |
---|
326 | ``name``. |
---|
327 | |
---|
328 | If the object specified by ``id`` is of a class that has a thirty-two bit |
---|
329 | integer style name, then the first four characters in ``*name`` will be used to |
---|
330 | construct the name. name to the RTEMS Workspace and allocate enough memory |
---|
331 | from the RTEMS Workspace to make a copy of the string |
---|
332 | |
---|
333 | .. _rtems_object_id_get_api: |
---|
334 | |
---|
335 | OBJECT_ID_GET_API - Obtain API from Id |
---|
336 | -------------------------------------- |
---|
337 | .. index:: obtain API from id |
---|
338 | |
---|
339 | **CALLING SEQUENCE:** |
---|
340 | |
---|
341 | .. index:: rtems_object_id_get_api |
---|
342 | |
---|
343 | .. code-block:: c |
---|
344 | |
---|
345 | int rtems_object_id_get_api( |
---|
346 | rtems_id id |
---|
347 | ); |
---|
348 | |
---|
349 | **DIRECTIVE STATUS CODES** |
---|
350 | |
---|
351 | Returns the API portion of the object Id. |
---|
352 | |
---|
353 | **DESCRIPTION:** |
---|
354 | |
---|
355 | This directive returns the API portion of the provided object ``id``. |
---|
356 | |
---|
357 | **NOTES:** |
---|
358 | |
---|
359 | This directive is strictly local and does not impact task scheduling. |
---|
360 | |
---|
361 | This directive does NOT validate the ``id`` provided. |
---|
362 | |
---|
363 | .. _rtems_object_id_get_class: |
---|
364 | |
---|
365 | OBJECT_ID_GET_CLASS - Obtain Class from Id |
---|
366 | ------------------------------------------ |
---|
367 | .. index:: obtain class from object id |
---|
368 | |
---|
369 | **CALLING SEQUENCE:** |
---|
370 | |
---|
371 | .. index:: rtems_object_id_get_class |
---|
372 | |
---|
373 | .. code-block:: c |
---|
374 | |
---|
375 | int rtems_object_id_get_class( |
---|
376 | rtems_id id |
---|
377 | ); |
---|
378 | |
---|
379 | **DIRECTIVE STATUS CODES** |
---|
380 | |
---|
381 | Returns the class portion of the object Id. |
---|
382 | |
---|
383 | **DESCRIPTION:** |
---|
384 | |
---|
385 | This directive returns the class portion of the provided object ``id``. |
---|
386 | |
---|
387 | **NOTES:** |
---|
388 | |
---|
389 | This directive is strictly local and does not impact task scheduling. |
---|
390 | |
---|
391 | This directive does NOT validate the ``id`` provided. |
---|
392 | |
---|
393 | .. _rtems_object_id_get_node: |
---|
394 | |
---|
395 | OBJECT_ID_GET_NODE - Obtain Node from Id |
---|
396 | ---------------------------------------- |
---|
397 | .. index:: obtain node from object id |
---|
398 | |
---|
399 | **CALLING SEQUENCE:** |
---|
400 | |
---|
401 | .. index:: rtems_object_id_get_node |
---|
402 | |
---|
403 | .. code-block:: c |
---|
404 | |
---|
405 | int rtems_object_id_get_node( |
---|
406 | rtems_id id |
---|
407 | ); |
---|
408 | |
---|
409 | **DIRECTIVE STATUS CODES** |
---|
410 | |
---|
411 | Returns the node portion of the object Id. |
---|
412 | |
---|
413 | **DESCRIPTION:** |
---|
414 | |
---|
415 | This directive returns the node portion of the provided object ``id``. |
---|
416 | |
---|
417 | **NOTES:** |
---|
418 | |
---|
419 | This directive is strictly local and does not impact task scheduling. |
---|
420 | |
---|
421 | This directive does NOT validate the ``id`` provided. |
---|
422 | |
---|
423 | .. _rtems_object_id_get_index: |
---|
424 | |
---|
425 | OBJECT_ID_GET_INDEX - Obtain Index from Id |
---|
426 | ------------------------------------------ |
---|
427 | .. index:: obtain index from object id |
---|
428 | |
---|
429 | **CALLING SEQUENCE:** |
---|
430 | |
---|
431 | .. index:: rtems_object_id_get_index |
---|
432 | |
---|
433 | .. code-block:: c |
---|
434 | |
---|
435 | int rtems_object_id_get_index( |
---|
436 | rtems_id id |
---|
437 | ); |
---|
438 | |
---|
439 | **DIRECTIVE STATUS CODES** |
---|
440 | |
---|
441 | Returns the index portion of the object Id. |
---|
442 | |
---|
443 | **DESCRIPTION:** |
---|
444 | |
---|
445 | This directive returns the index portion of the provided object ``id``. |
---|
446 | |
---|
447 | **NOTES:** |
---|
448 | |
---|
449 | This directive is strictly local and does not impact task scheduling. |
---|
450 | |
---|
451 | This directive does NOT validate the ``id`` provided. |
---|
452 | |
---|
453 | .. _rtems_build_id: |
---|
454 | |
---|
455 | BUILD_ID - Build Object Id From Components |
---|
456 | ------------------------------------------ |
---|
457 | .. index:: build object id from components |
---|
458 | |
---|
459 | **CALLING SEQUENCE:** |
---|
460 | |
---|
461 | .. index:: rtems_build_id |
---|
462 | |
---|
463 | .. code-block:: c |
---|
464 | |
---|
465 | rtems_id rtems_build_id( |
---|
466 | int the_api, |
---|
467 | int the_class, |
---|
468 | int the_node, |
---|
469 | int the_index |
---|
470 | ); |
---|
471 | |
---|
472 | **DIRECTIVE STATUS CODES** |
---|
473 | |
---|
474 | Returns an object Id constructed from the provided arguments. |
---|
475 | |
---|
476 | **DESCRIPTION:** |
---|
477 | |
---|
478 | This service constructs an object Id from the provided ``the_api``, |
---|
479 | ``the_class``, ``the_node``, and ``the_index``. |
---|
480 | |
---|
481 | **NOTES:** |
---|
482 | |
---|
483 | This directive is strictly local and does not impact task scheduling. |
---|
484 | |
---|
485 | This directive does NOT validate the arguments provided or the Object id |
---|
486 | returned. |
---|
487 | |
---|
488 | .. _rtems_object_id_api_minimum: |
---|
489 | |
---|
490 | OBJECT_ID_API_MINIMUM - Obtain Minimum API Value |
---|
491 | ------------------------------------------------ |
---|
492 | .. index:: obtain minimum API value |
---|
493 | |
---|
494 | **CALLING SEQUENCE:** |
---|
495 | |
---|
496 | .. index:: rtems_object_id_api_minimum |
---|
497 | |
---|
498 | .. code-block:: c |
---|
499 | |
---|
500 | int rtems_object_id_api_minimum(void); |
---|
501 | |
---|
502 | **DIRECTIVE STATUS CODES** |
---|
503 | |
---|
504 | Returns the minimum valid for the API portion of an object Id. |
---|
505 | |
---|
506 | **DESCRIPTION:** |
---|
507 | |
---|
508 | This service returns the minimum valid for the API portion of an object Id. |
---|
509 | |
---|
510 | **NOTES:** |
---|
511 | |
---|
512 | This directive is strictly local and does not impact task scheduling. |
---|
513 | |
---|
514 | .. _rtems_object_id_api_maximum: |
---|
515 | |
---|
516 | OBJECT_ID_API_MAXIMUM - Obtain Maximum API Value |
---|
517 | ------------------------------------------------ |
---|
518 | .. index:: obtain maximum API value |
---|
519 | |
---|
520 | **CALLING SEQUENCE:** |
---|
521 | |
---|
522 | .. index:: rtems_object_id_api_maximum |
---|
523 | |
---|
524 | .. code-block:: c |
---|
525 | |
---|
526 | int rtems_object_id_api_maximum(void); |
---|
527 | |
---|
528 | **DIRECTIVE STATUS CODES** |
---|
529 | |
---|
530 | Returns the maximum valid for the API portion of an object Id. |
---|
531 | |
---|
532 | **DESCRIPTION:** |
---|
533 | |
---|
534 | This service returns the maximum valid for the API portion of an object Id. |
---|
535 | |
---|
536 | **NOTES:** |
---|
537 | |
---|
538 | This directive is strictly local and does not impact task scheduling. |
---|
539 | |
---|
540 | .. _rtems_object_api_minimum_class: |
---|
541 | |
---|
542 | OBJECT_API_MINIMUM_CLASS - Obtain Minimum Class Value |
---|
543 | ----------------------------------------------------- |
---|
544 | .. index:: obtain minimum class value |
---|
545 | |
---|
546 | **CALLING SEQUENCE:** |
---|
547 | |
---|
548 | .. index:: rtems_object_api_minimum_class |
---|
549 | |
---|
550 | .. code-block:: c |
---|
551 | |
---|
552 | int rtems_object_api_minimum_class( |
---|
553 | int api |
---|
554 | ); |
---|
555 | |
---|
556 | **DIRECTIVE STATUS CODES** |
---|
557 | |
---|
558 | If ``api`` is not valid, -1 is returned. |
---|
559 | |
---|
560 | If successful, this service returns the minimum valid for the class portion of |
---|
561 | an object Id for the specified ``api``. |
---|
562 | |
---|
563 | **DESCRIPTION:** |
---|
564 | |
---|
565 | This service returns the minimum valid for the class portion of an object Id |
---|
566 | for the specified ``api``. |
---|
567 | |
---|
568 | **NOTES:** |
---|
569 | |
---|
570 | This directive is strictly local and does not impact task scheduling. |
---|
571 | |
---|
572 | .. _rtems_object_api_maximum_class: |
---|
573 | |
---|
574 | OBJECT_API_MAXIMUM_CLASS - Obtain Maximum Class Value |
---|
575 | ----------------------------------------------------- |
---|
576 | .. index:: obtain maximum class value |
---|
577 | |
---|
578 | **CALLING SEQUENCE:** |
---|
579 | |
---|
580 | .. index:: rtems_object_api_maximum_class |
---|
581 | |
---|
582 | .. code-block:: c |
---|
583 | |
---|
584 | int rtems_object_api_maximum_class( |
---|
585 | int api |
---|
586 | ); |
---|
587 | |
---|
588 | **DIRECTIVE STATUS CODES** |
---|
589 | |
---|
590 | If ``api`` is not valid, -1 is returned. |
---|
591 | |
---|
592 | If successful, this service returns the maximum valid for the class portion of |
---|
593 | an object Id for the specified ``api``. |
---|
594 | |
---|
595 | **DESCRIPTION:** |
---|
596 | |
---|
597 | This service returns the maximum valid for the class portion of an object Id |
---|
598 | for the specified ``api``. |
---|
599 | |
---|
600 | **NOTES:** |
---|
601 | |
---|
602 | This directive is strictly local and does not impact task scheduling. |
---|
603 | |
---|
604 | .. _rtems_object_id_api_minimum_class: |
---|
605 | |
---|
606 | OBJECT_ID_API_MINIMUM_CLASS - Obtain Minimum Class Value for an API |
---|
607 | ------------------------------------------------------------------- |
---|
608 | .. index:: obtain minimum class value for an API |
---|
609 | |
---|
610 | **CALLING SEQUENCE:** |
---|
611 | |
---|
612 | .. index:: rtems_object_id_api_minimum_class |
---|
613 | |
---|
614 | .. code-block:: c |
---|
615 | |
---|
616 | int rtems_object_get_id_api_minimum_class( |
---|
617 | int api |
---|
618 | ); |
---|
619 | |
---|
620 | **DIRECTIVE STATUS CODES** |
---|
621 | |
---|
622 | If ``api`` is not valid, -1 is returned. |
---|
623 | |
---|
624 | If successful, this service returns the index corresponding to the first |
---|
625 | object class of the specified ``api``. |
---|
626 | |
---|
627 | **DESCRIPTION:** |
---|
628 | |
---|
629 | This service returns the index for the first object class associated with |
---|
630 | the specified ``api``. |
---|
631 | |
---|
632 | **NOTES:** |
---|
633 | |
---|
634 | This directive is strictly local and does not impact task scheduling. |
---|
635 | |
---|
636 | .. _rtems_object_id_api_maximum_class: |
---|
637 | |
---|
638 | OBJECT_ID_API_MAXIMUM_CLASS - Obtain Maximum Class Value for an API |
---|
639 | ------------------------------------------------------------------- |
---|
640 | .. index:: obtain maximum class value for an API |
---|
641 | |
---|
642 | **CALLING SEQUENCE:** |
---|
643 | |
---|
644 | .. index:: rtems_object_id_api_maximum_class |
---|
645 | |
---|
646 | .. code-block:: c |
---|
647 | |
---|
648 | int rtems_object_get_api_maximum_class( |
---|
649 | int api |
---|
650 | ); |
---|
651 | |
---|
652 | **DIRECTIVE STATUS CODES** |
---|
653 | |
---|
654 | If ``api`` is not valid, -1 is returned. |
---|
655 | |
---|
656 | If successful, this service returns the index corresponding to the last |
---|
657 | object class of the specified ``api``. |
---|
658 | |
---|
659 | **DESCRIPTION:** |
---|
660 | |
---|
661 | This service returns the index for the last object class associated with |
---|
662 | the specified ``api``. |
---|
663 | |
---|
664 | **NOTES:** |
---|
665 | |
---|
666 | This directive is strictly local and does not impact task scheduling. |
---|
667 | |
---|
668 | .. _rtems_object_get_api_name: |
---|
669 | |
---|
670 | OBJECT_GET_API_NAME - Obtain API Name |
---|
671 | ------------------------------------- |
---|
672 | .. index:: obtain API name |
---|
673 | |
---|
674 | **CALLING SEQUENCE:** |
---|
675 | |
---|
676 | .. index:: rtems_object_get_api_name |
---|
677 | |
---|
678 | .. code-block:: c |
---|
679 | |
---|
680 | const char* rtems_object_get_api_name( |
---|
681 | int api |
---|
682 | ); |
---|
683 | |
---|
684 | **DIRECTIVE STATUS CODES** |
---|
685 | |
---|
686 | If ``api`` is not valid, the string ``"BAD API"`` is returned. |
---|
687 | |
---|
688 | If successful, this service returns a pointer to a string containing the name |
---|
689 | of the specified ``api``. |
---|
690 | |
---|
691 | **DESCRIPTION:** |
---|
692 | |
---|
693 | This service returns the name of the specified ``api``. |
---|
694 | |
---|
695 | **NOTES:** |
---|
696 | |
---|
697 | This directive is strictly local and does not impact task scheduling. |
---|
698 | |
---|
699 | The string returned is from constant space. Do not modify or free it. |
---|
700 | |
---|
701 | .. _rtems_object_get_api_class_name: |
---|
702 | |
---|
703 | OBJECT_GET_API_CLASS_NAME - Obtain Class Name |
---|
704 | --------------------------------------------- |
---|
705 | .. index:: obtain class name |
---|
706 | |
---|
707 | **CALLING SEQUENCE:** |
---|
708 | |
---|
709 | .. index:: rtems_object_get_api_class_name |
---|
710 | |
---|
711 | .. code-block:: c |
---|
712 | |
---|
713 | const char *rtems_object_get_api_class_name( |
---|
714 | int the_api, |
---|
715 | int the_class |
---|
716 | ); |
---|
717 | |
---|
718 | **DIRECTIVE STATUS CODES** |
---|
719 | |
---|
720 | If ``the_api`` is not valid, the string ``"BAD API"`` is returned. |
---|
721 | |
---|
722 | If ``the_class`` is not valid, the string ``"BAD CLASS"`` is returned. |
---|
723 | |
---|
724 | If successful, this service returns a pointer to a string containing the name |
---|
725 | of the specified ``the_api`` / ``the_class`` pair. |
---|
726 | |
---|
727 | **DESCRIPTION:** |
---|
728 | |
---|
729 | This service returns the name of the object class indicated by the specified |
---|
730 | ``the_api`` and ``the_class``. |
---|
731 | |
---|
732 | **NOTES:** |
---|
733 | |
---|
734 | This directive is strictly local and does not impact task scheduling. |
---|
735 | |
---|
736 | The string returned is from constant space. Do not modify or free it. |
---|
737 | |
---|
738 | .. _rtems_object_get_class_information: |
---|
739 | |
---|
740 | OBJECT_GET_CLASS_INFORMATION - Obtain Class Information |
---|
741 | ------------------------------------------------------- |
---|
742 | .. index:: obtain class information |
---|
743 | |
---|
744 | **CALLING SEQUENCE:** |
---|
745 | |
---|
746 | .. index:: rtems_object_get_class_information |
---|
747 | |
---|
748 | .. code-block:: c |
---|
749 | |
---|
750 | rtems_status_code rtems_object_get_class_information( |
---|
751 | int the_api, |
---|
752 | int the_class, |
---|
753 | rtems_object_api_class_information *info |
---|
754 | ); |
---|
755 | |
---|
756 | **DIRECTIVE STATUS CODES** |
---|
757 | |
---|
758 | .. list-table:: |
---|
759 | :class: rtems-table |
---|
760 | |
---|
761 | * - ``RTEMS_SUCCESSFUL`` |
---|
762 | - information obtained successfully |
---|
763 | * - ``RTEMS_INVALID_ADDRESS`` |
---|
764 | - ``info`` is NULL |
---|
765 | * - ``RTEMS_INVALID_NUMBER`` |
---|
766 | - invalid ``api`` or ``the_class`` |
---|
767 | |
---|
768 | If successful, the structure located at ``info`` will be filled in with |
---|
769 | information about the specified ``api`` / ``the_class`` pairing. |
---|
770 | |
---|
771 | **DESCRIPTION:** |
---|
772 | |
---|
773 | This service returns information about the object class indicated by the |
---|
774 | specified ``api`` and ``the_class``. This structure is defined as follows: |
---|
775 | |
---|
776 | .. code-block:: c |
---|
777 | |
---|
778 | typedef struct { |
---|
779 | rtems_id minimum_id; |
---|
780 | rtems_id maximum_id; |
---|
781 | int maximum; |
---|
782 | bool auto_extend; |
---|
783 | int unallocated; |
---|
784 | } rtems_object_api_class_information; |
---|
785 | |
---|
786 | **NOTES:** |
---|
787 | |
---|
788 | This directive is strictly local and does not impact task scheduling. |
---|