source: rtems/cpukit/score/inline/rtems/score/object.inl @ ac7d5ef0

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on May 11, 1995 at 5:39:37 PM

Initial revision

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/*  object.inl
2 *
3 *  This include file contains the static inline implementation of all
4 *  of the inlined routines in the Object Handler.
5 *
6 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16
17#ifndef __OBJECTS_inl
18#define __OBJECTS_inl
19
20/*PAGE
21 *
22 *  _Objects_Is_name_valid
23 *
24 */
25
26STATIC INLINE boolean _Objects_Is_name_valid (
27  Objects_Name name
28)
29{
30  return ( name != 0 );
31}
32
33/*PAGE
34 *
35 *  rtems_name_to_characters
36 *
37 */
38
39STATIC INLINE void rtems_name_to_characters(
40  Objects_Name  name,
41  char         *c1,
42  char         *c2,
43  char         *c3,
44  char         *c4
45)
46{
47  *c1 = (name >> 24) & 0xff;
48  *c2 = (name >> 16) & 0xff;
49  *c3 = (name >> 8) & 0xff;
50  *c4 =  name & 0xff;
51}
52
53/*PAGE
54 *
55 *  _Objects_Build_id
56 *
57 */
58
59STATIC INLINE Objects_Id _Objects_Build_id(
60  unsigned32 node,
61  unsigned32 index
62)
63{
64  return ( (node << 16) | index );
65}
66
67/*PAGE
68 *
69 *  rtems_get_node
70 *
71 */
72
73STATIC INLINE unsigned32 rtems_get_node(
74  Objects_Id id
75)
76{
77  return (id >> 16);
78}
79
80/*PAGE
81 *
82 *  rtems_get_index
83 *
84 */
85
86STATIC INLINE unsigned32 rtems_get_index(
87  Objects_Id id
88)
89{
90  return (id &0xFFFF);
91}
92
93/*PAGE
94 *
95 *  _Objects_Is_local_node
96 *
97 */
98
99STATIC INLINE boolean _Objects_Is_local_node(
100  unsigned32 node
101)
102{
103  return ( node == _Objects_Local_node );
104}
105
106/*PAGE
107 *
108 *  _Objects_Is_local_id
109 *
110 */
111
112STATIC INLINE boolean _Objects_Is_local_id(
113  Objects_Id id
114)
115{
116  return _Objects_Is_local_node( rtems_get_node(id) );
117}
118
119/*PAGE
120 *
121 *  _Objects_Are_ids_equal
122 *
123 */
124
125STATIC INLINE boolean _Objects_Are_ids_equal(
126  Objects_Id left,
127  Objects_Id right
128)
129{
130  return ( left == right );
131}
132
133/*PAGE
134 *
135 *  _Objects_Allocate
136 *
137 */
138
139STATIC INLINE Objects_Control *_Objects_Allocate(
140  Objects_Information *information
141)
142{
143  return (Objects_Control *) _Chain_Get( &information->Inactive );
144}
145
146/*PAGE
147 *
148 *  _Objects_Free
149 *
150 */
151
152STATIC INLINE void _Objects_Free(
153  Objects_Information *information,
154  Objects_Control     *the_object
155)
156{
157  _Chain_Append( &information->Inactive, &the_object->Node );
158}
159
160/*PAGE
161 *
162 *  _Objects_Open
163 *
164 */
165
166STATIC INLINE void _Objects_Open(
167  Objects_Information *information,
168  Objects_Control     *the_object,
169  Objects_Name         name
170)
171{
172  unsigned32 index;
173
174  index = rtems_get_index( the_object->id );
175  information->local_table[ index ] = the_object;
176  information->name_table[ index ]  = name;
177}
178
179/*PAGE
180 *
181 *  _Objects_Close
182 *
183 */
184
185STATIC INLINE void _Objects_Close(
186  Objects_Information  *information,
187  Objects_Control      *the_object
188)
189{
190  unsigned32 index;
191
192  index = rtems_get_index( the_object->id );
193  information->local_table[ index ] = NULL;
194  information->name_table[ index ]  = 0;
195}
196
197#endif
198/* end of include file */
Note: See TracBrowser for help on using the repository browser.