source: rtems/c/src/exec/score/macros/object.inl @ 4ca27cf

4.104.114.84.95
Last change on this file since 4ca27cf was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • Property mode set to 100644
File size: 2.5 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, 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
26#define _Objects_Is_name_valid( _name ) \
27  ( (_name) != 0 )
28
29/*
30 *  rtems_name_to_characters
31 *
32 */
33
34#define rtems_name_to_characters( _name, _c1, _c2, _c3, _c4 ) \
35  { \
36    (*(_c1) = ((_name) >> 24) & 0xff; \
37    (*(_c2) = ((_name) >> 16) & 0xff; \
38    (*(_c3) = ((_name) >> 8) & 0xff; \
39    (*(_c4) = ((_name)) & 0xff; \
40  }
41);
42
43/*PAGE
44 *
45 *  _Objects_Build_id
46 *
47 */
48
49#define _Objects_Build_id( _node, _index ) \
50  ( ((_node) << 16) | (_index) )
51
52/*PAGE
53 *
54 *  rtems_get_node
55 *
56 */
57
58#define rtems_get_node( _id ) \
59  ((_id) >> 16)
60
61/*PAGE
62 *
63 *  rtems_get_index
64 *
65 */
66
67#define rtems_get_index( _id ) \
68  ((_id) & 0xFFFF)
69
70/*PAGE
71 *
72 *  _Objects_Is_local_node
73 *
74 */
75
76#define _Objects_Is_local_node( _node ) \
77  ( (_node) == _Objects_Local_node )
78
79/*PAGE
80 *
81 *  _Objects_Is_local_id
82 *
83 */
84
85#define _Objects_Is_local_id( _id ) \
86  _Objects_Is_local_node( rtems_get_node(_id) )
87
88/*PAGE
89 *
90 *  _Objects_Are_ids_equal
91 *
92 */
93
94#define _Objects_Are_ids_equal( _left, _right ) \
95  ( (_left) == (_right) )
96
97/*PAGE
98 *
99 *  _Objects_Allocate
100 *
101 */
102
103#define _Objects_Allocate( _information )  \
104  (Objects_Control *) _Chain_Get( &(_information)->Inactive )
105
106/*PAGE
107 *
108 *  _Objects_Free
109 *
110 */
111
112#define _Objects_Free( _information, _the_object )  \
113  _Chain_Append( &(_information)->Inactive, &(_the_object)->Node )
114
115/*PAGE
116 *
117 *  _Objects_Open
118 *
119 */
120
121#define _Objects_Open( _information, _the_object, _name ) \
122  { \
123    unsigned32 _index; \
124    \
125    _index = rtems_get_index( (_the_object)->id ); \
126    (_information)->local_table[ _index ] = (_the_object); \
127    (_information)->name_table[ _index ]  = (_name); \
128  }
129
130/*PAGE
131 *
132 *  _Objects_Close
133 *
134 */
135
136#define _Objects_Close( _information, _the_object ) \
137  { \
138    unsigned32 _index; \
139    \
140    _index = rtems_get_index( (_the_object)->id ); \
141    (_information)->local_table[ _index ] = NULL; \
142    (_information)->name_table[ _index ]  = 0; \
143  }
144
145#endif
146/* end of include file */
Note: See TracBrowser for help on using the repository browser.