source: rtems/c/src/exec/score/macros/rtems/score/object.inl @ 20f54e9

4.104.114.84.95
Last change on this file since 20f54e9 was f4a8ee1, checked in by Joel Sherrill <joel.sherrill@…>, on 03/17/99 at 16:01:03

Unlimited objects patch from Chris Johns <ccj@…>. Email follows:

First, the unlimited patch. I have compiled the unlmited patch for the
Linux posix BSP only and it seems to work cleanly. I would like a really
major application run on this change before commiting as the changes are
very core and significant. I am currently building all the tests to run.

I have no targets suitable to test on at the moment.

I have tested the patch for inline functions and macros.

Turning macros on has found some core bugs. I have fixed these but have
not run all the tests. Please review the patch for these changes. They
are:

1) The conditional compilation for MP support broke the core messages
code. You cannot embed a conditional macro in another macro. The Send
and Urgent Send calls are macros.

2) User extensions handler initialisation now has two parameters. I have
updated the macros to support the extra parameter.

The patch also contains the gcc-target-default.cfg fix required to build
the kernel. More of a by product than a fix for you.

  • Property mode set to 100644
File size: 3.2 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-1998.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#ifndef __OBJECTS_inl
18#define __OBJECTS_inl
19
20/*PAGE
21 *
22 *  _Objects_Build_id
23 *
24 */
25
26#define _Objects_Build_id( _the_class, _node, _index ) \
27  ( ((_the_class) << OBJECTS_CLASS_START_BIT) | \
28    ((_node) << OBJECTS_NODE_START_BIT)       | \
29    ((_index) << OBJECTS_INDEX_START_BIT) )
30
31/*PAGE
32 *
33 *  _Objects_Get_class
34 */
35 
36#define _Objects_Get_class( _id ) \
37  (Objects_Classes) \
38    (((_id) >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS)
39
40/*PAGE
41 *
42 *  _Objects_Get_node
43 *
44 */
45
46#define _Objects_Get_node( _id ) \
47  (((_id) >> OBJECTS_NODE_START_BIT) & OBJECTS_NODE_VALID_BITS)
48
49/*PAGE
50 *
51 *  _Objects_Get_index
52 *
53 */
54
55#define _Objects_Get_index( _id ) \
56  (((_id) >> OBJECTS_INDEX_START_BIT) & OBJECTS_INDEX_VALID_BITS)
57
58/*PAGE
59 *
60 *  _Objects_Is_class_valid
61 *
62 */
63 
64#define _Objects_Is_class_valid( _the_class ) \
65  ( (_the_class) && (_the_class) <= OBJECTS_CLASSES_LAST )
66
67/*PAGE
68 *
69 *  _Objects_Is_local_node
70 *
71 */
72
73#define _Objects_Is_local_node( _node ) \
74  ( (_node) == _Objects_Local_node )
75
76/*PAGE
77 *
78 *  _Objects_Is_local_id
79 *
80 */
81
82#define _Objects_Is_local_id( _id ) \
83  _Objects_Is_local_node( _Objects_Get_node(_id) )
84
85/*PAGE
86 *
87 *  _Objects_Are_ids_equal
88 *
89 */
90
91#define _Objects_Are_ids_equal( _left, _right ) \
92  ( (_left) == (_right) )
93
94/*PAGE
95 *
96 *  _Objects_Get_local_object
97 *
98 */
99
100#define _Objects_Get_local_object( information, index ) \
101  ( ( index > information->maximum) ?  NULL : \
102                       information->local_table[ index ] )
103
104/*PAGE
105 *
106 *  _Objects_Set_local_object
107 *
108 */
109
110#define _Objects_Set_local_object( information, index, the_object ) \
111  { \
112    if ( index <= information->maximum) \
113      information->local_table[ index ] = the_object; \
114  }
115
116
117/*PAGE
118 *
119 *  _Objects_Get_information
120 *
121 */
122 
123#define _Objects_Get_information( id ) \
124 ( \
125   ( !_Objects_Is_class_valid( _Objects_Get_class( id ) ) ) ? \
126     NULL : \
127     _Objects_Information_table[ _Objects_Get_class( id ) ] \
128 )
129
130/*PAGE
131 *
132 *  _Objects_Open
133 *
134 */
135
136#define _Objects_Open( _information, _the_object, _name ) \
137  { \
138    unsigned32 _index; \
139    \
140    _index = _Objects_Get_index( (_the_object)->id ); \
141    (_information)->local_table[ _index ] = (_the_object); \
142    \
143    if ( (_information)->is_string ) \
144      _Objects_Copy_name_string( (_name), (_the_object)->name ); \
145    else \
146      _Objects_Copy_name_raw( \
147        (_name), (_the_object)->name, (_information)->name_length ); \
148  }
149
150/*PAGE
151 *
152 *  _Objects_Close
153 *
154 */
155
156#define _Objects_Close( _information, _the_object ) \
157  { \
158    unsigned32 _index; \
159    \
160    _index = _Objects_Get_index( (_the_object)->id ); \
161    (_information)->local_table[ _index ] = (Objects_Control *) NULL; \
162    _Objects_Clear_name( (_the_object)->name, (_information)->name_length ); \
163  }
164
165#endif
166/* end of include file */
Note: See TracBrowser for help on using the repository browser.