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