source: rtems/cpukit/score/macros/rtems/score/object.inl @ d6154c7

4.104.114.84.95
Last change on this file since d6154c7 was d6154c7, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 29, 2004 at 4:41:13 PM

2004-03-29 Ralf Corsepius <ralf_corsepius@…>

  • score/include/rtems/debug.h, score/include/rtems/score/bitfield.h, score/include/rtems/score/chain.h, score/include/rtems/score/coremsg.h, score/include/rtems/score/coremutex.h, score/include/rtems/score/coresem.h, score/include/rtems/score/heap.h, score/include/rtems/score/interr.h, score/include/rtems/score/isr.h, score/include/rtems/score/mpci.h, score/include/rtems/score/mppkt.h, score/include/rtems/score/object.h, score/include/rtems/score/objectmp.h, score/include/rtems/score/priority.h, score/include/rtems/score/stack.h, score/include/rtems/score/states.h, score/include/rtems/score/thread.h, score/include/rtems/score/threadmp.h, score/include/rtems/score/threadq.h, score/include/rtems/score/tod.h, score/include/rtems/score/tqdata.h, score/include/rtems/score/userext.h, score/include/rtems/score/watchdog.h, score/include/rtems/score/wkspace.h, score/inline/rtems/score/address.inl, score/inline/rtems/score/coremsg.inl, score/inline/rtems/score/coresem.inl, score/inline/rtems/score/heap.inl, score/inline/rtems/score/isr.inl, score/inline/rtems/score/object.inl, score/inline/rtems/score/priority.inl, score/inline/rtems/score/stack.inl, score/inline/rtems/score/thread.inl, score/inline/rtems/score/tqdata.inl, score/inline/rtems/score/userext.inl, score/inline/rtems/score/wkspace.inl, score/macros/rtems/score/address.inl, score/macros/rtems/score/heap.inl, score/macros/rtems/score/object.inl, score/macros/rtems/score/priority.inl, score/macros/rtems/score/userext.inl: Convert to using c99 fixed size types.
  • Property mode set to 100644
File size: 3.8 KB
Line 
1/*  object.inl
2 *
3 *  This include file contains the macro implementation of all
4 *  of the inlined routines in the Object Handler.
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef __OBJECTS_inl
17#define __OBJECTS_inl
18
19/*PAGE
20 *
21 *  _Objects_Build_id
22 *
23 */
24
25#define _Objects_Build_id( _the_api, _the_class, _node, _index ) \
26  ( (( (Objects_Id) _the_api ) << OBJECTS_API_START_BIT) | \
27    (( (Objects_Id) _the_class ) << OBJECTS_CLASS_START_BIT) | \
28    (( (Objects_Id) _node ) << OBJECTS_NODE_START_BIT)       | \
29    (( (Objects_Id) _index ) << OBJECTS_INDEX_START_BIT) )
30
31/*PAGE
32 *
33 *  _Objects_Get_API
34 */
35 
36#define _Objects_Get_API( _id ) \
37  (Objects_APIs) \
38    (((_id) >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS)
39
40/*PAGE
41 *
42 *  _Objects_Get_class
43 */
44 
45#define _Objects_Get_class( _id ) \
46  (uint32_t  ) \
47    (((_id) >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS)
48
49/*PAGE
50 *
51 *  _Objects_Get_node
52 *
53 */
54
55#define _Objects_Get_node( _id ) \
56  (((_id) >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS)
57
58/*PAGE
59 *
60 *  _Objects_Get_index
61 *
62 */
63
64#define _Objects_Get_index( _id ) \
65  (((_id) >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS)
66
67/*PAGE
68 *
69 *  _Objects_Is_class_valid
70 *
71 */
72 
73#define _Objects_Is_class_valid( _the_class ) \
74  ( (_the_class) /* XXX && (_the_class) <= OBJECTS_CLASSES_LAST */ )
75
76/*PAGE
77 *
78 *  _Objects_Is_local_node
79 *
80 */
81
82#define _Objects_Is_local_node( _node ) \
83  ( (_node) == _Objects_Local_node )
84
85/*PAGE
86 *
87 *  _Objects_Is_local_id
88 *
89 */
90
91#define _Objects_Is_local_id( _id ) \
92  _Objects_Is_local_node( _Objects_Get_node(_id) )
93
94/*PAGE
95 *
96 *  _Objects_Are_ids_equal
97 *
98 */
99
100#define _Objects_Are_ids_equal( _left, _right ) \
101  ( (_left) == (_right) )
102
103/*PAGE
104 *
105 *  _Objects_Get_local_object
106 *
107 */
108
109#define _Objects_Get_local_object( _information, _index ) \
110  ( ( (_index) > (_information)->maximum) ?  NULL : \
111                       (_information)->local_table[ (_index) ] )
112
113/*PAGE
114 *
115 *  _Objects_Set_local_object
116 *
117 */
118
119#define _Objects_Set_local_object( information, index, the_object ) \
120  { \
121    if ( index <= information->maximum) \
122      information->local_table[ index ] = the_object; \
123  }
124
125
126/*PAGE
127 *
128 *  _Objects_Get_information
129 *
130 */
131 
132#define _Objects_Get_information( id ) \
133 ( \
134   ( !_Objects_Is_class_valid( _Objects_Get_class( id ) ) ) ? \
135     NULL : \
136     _Objects_Information_table[ _Objects_Get_API( id ) ] \
137       [ _Objects_Get_class( id ) ] \
138 )
139
140/*PAGE
141 *
142 *  _Objects_Open
143 *
144 */
145
146#define _Objects_Open( _information, _the_object, _name ) \
147  do { \
148    uint32_t   _index; \
149    \
150    _index = _Objects_Get_index( (_the_object)->id ); \
151    (_information)->local_table[ _index ] = (_the_object); \
152    \
153    if ( (_information)->is_string ) \
154      /* _Objects_Copy_name_string( (_name), (_the_object)->name ); */\
155      (_the_object)->name = (_name); \
156    else \
157      /* _Objects_Copy_name_raw( \
158        (_name), (_the_object)->name, (_information)->name_length ); */ \
159      (_the_object)->name = (_name); \
160  } while (0)
161
162/*PAGE
163 *
164 *  _Objects_Close
165 *
166 */
167
168#define _Objects_Close( _information, _the_object ) \
169  do { \
170    uint32_t   _index; \
171    \
172    _index = _Objects_Get_index( (_the_object)->id ); \
173    (_information)->local_table[ _index ] = (Objects_Control *) NULL; \
174    /* _Objects_Clear_name( (_the_object)->name, (_information)->name_length );  */ \
175    (_the_object)->name = 0; \
176  } while (0)
177
178/*PAGE
179 *
180 *  _Objects_Namespace_remove
181 */
182
183#define _Objects_Namespace_remove( _information, _the_object ) \
184  (_the_object)->name = 0; \
185  /* _Objects_Clear_name( (_the_object)->name, (_information)->name_length ) */
186
187#endif
188/* end of include file */
Note: See TracBrowser for help on using the repository browser.