5
Last change
on this file since b2de426 was
c499856,
checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47
|
Change all references of rtems.com to rtems.org.
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Get Class Information |
---|
5 | * @ingroup ClassicClassInfo |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2008. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <rtems/rtems/object.h> |
---|
22 | #include <rtems/score/objectimpl.h> |
---|
23 | |
---|
24 | rtems_status_code rtems_object_get_class_information( |
---|
25 | int the_api, |
---|
26 | int the_class, |
---|
27 | rtems_object_api_class_information *info |
---|
28 | ) |
---|
29 | { |
---|
30 | Objects_Information *obj_info; |
---|
31 | int unallocated; |
---|
32 | int i; |
---|
33 | |
---|
34 | /* |
---|
35 | * Validate parameters and look up information structure. |
---|
36 | */ |
---|
37 | if ( !info ) |
---|
38 | return RTEMS_INVALID_ADDRESS; |
---|
39 | |
---|
40 | obj_info = _Objects_Get_information( the_api, the_class ); |
---|
41 | if ( !obj_info ) |
---|
42 | return RTEMS_INVALID_NUMBER; |
---|
43 | |
---|
44 | /* |
---|
45 | * Return information about this object class to the user. |
---|
46 | */ |
---|
47 | info->minimum_id = obj_info->minimum_id; |
---|
48 | info->maximum_id = obj_info->maximum_id; |
---|
49 | info->auto_extend = obj_info->auto_extend; |
---|
50 | info->maximum = obj_info->maximum; |
---|
51 | |
---|
52 | for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) |
---|
53 | if ( !obj_info->local_table[i] ) |
---|
54 | unallocated++; |
---|
55 | |
---|
56 | info->unallocated = unallocated; |
---|
57 | |
---|
58 | return RTEMS_SUCCESSFUL; |
---|
59 | } |
---|
60 | |
---|
Note: See
TracBrowser
for help on using the repository browser.