RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
cpukit
include
rtems
score
object.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
12
13
/*
14
* COPYRIGHT (c) 1989-2011.
15
* On-Line Applications Research Corporation (OAR).
16
*
17
* Redistribution and use in source and binary forms, with or without
18
* modification, are permitted provided that the following conditions
19
* are met:
20
* 1. Redistributions of source code must retain the above copyright
21
* notice, this list of conditions and the following disclaimer.
22
* 2. Redistributions in binary form must reproduce the above copyright
23
* notice, this list of conditions and the following disclaimer in the
24
* documentation and/or other materials provided with the distribution.
25
*
26
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36
* POSSIBILITY OF SUCH DAMAGE.
37
*/
38
39
#ifndef _RTEMS_SCORE_OBJECT_H
40
#define _RTEMS_SCORE_OBJECT_H
41
42
#include <
rtems/score/basedefs.h
>
43
#include <rtems/score/cpu.h>
44
45
#ifdef __cplusplus
46
extern
"C"
{
47
#endif
48
58
67
80
85
typedef
union
{
87
const
char
*
name_p
;
89
uint32_t
name_u32
;
90
}
Objects_Name
;
91
101
typedef
uint32_t
Objects_Id
;
102
107
typedef
uint16_t
Objects_Maximum
;
108
113
#define OBJECTS_INDEX_START_BIT 0U
118
#define OBJECTS_NODE_START_BIT 16U
119
124
#define OBJECTS_API_START_BIT 24U
125
130
#define OBJECTS_CLASS_START_BIT 27U
131
135
#define OBJECTS_INDEX_MASK (Objects_Id)0x0000ffffU
136
140
#define OBJECTS_NODE_MASK (Objects_Id)0x00ff0000U
141
145
#define OBJECTS_API_MASK (Objects_Id)0x07000000U
146
150
#define OBJECTS_CLASS_MASK (Objects_Id)0xf8000000U
151
156
#define OBJECTS_INDEX_VALID_BITS (Objects_Id)0x0000ffffU
157
162
#define OBJECTS_NODE_VALID_BITS (Objects_Id)0x000000ffU
163
168
#define OBJECTS_API_VALID_BITS (Objects_Id)0x00000007U
169
174
#define OBJECTS_CLASS_VALID_BITS (Objects_Id)0x0000001fU
175
180
#define OBJECTS_UNLIMITED_OBJECTS 0x80000000U
181
185
#define OBJECTS_ID_INITIAL_INDEX (0)
186
190
#define OBJECTS_ID_FINAL_INDEX (0xffffU)
191
195
typedef
enum
{
196
OBJECTS_NO_API = 0,
197
OBJECTS_INTERNAL_API = 1,
198
OBJECTS_CLASSIC_API = 2,
199
OBJECTS_POSIX_API = 3,
200
OBJECTS_FAKE_OBJECTS_API = 7
201
}
Objects_APIs
;
202
204
#define OBJECTS_APIS_LAST OBJECTS_POSIX_API
205
209
#define OBJECTS_ID_NONE 0
210
215
#define OBJECTS_ID_OF_SELF ((Objects_Id) 0)
216
221
#define OBJECTS_SEARCH_ALL_NODES 0
222
227
#define OBJECTS_SEARCH_OTHER_NODES 0x7FFFFFFE
228
233
#define OBJECTS_SEARCH_LOCAL_NODE 0x7FFFFFFF
234
239
#define OBJECTS_WHO_AM_I 0
240
245
#define OBJECTS_ID_INITIAL(_api, _class, _node) \
246
_Objects_Build_id( (_api), (_class), (_node), OBJECTS_ID_INITIAL_INDEX )
247
251
#define OBJECTS_ID_FINAL ((Objects_Id)~0)
252
263
#define _Objects_Build_name( _C1, _C2, _C3, _C4 ) \
264
( (uint32_t) (uint8_t) (_C1) << 24 | \
265
(uint32_t) (uint8_t) (_C2) << 16 | \
266
(uint32_t) (uint8_t) (_C3) << 8 | \
267
(uint8_t) (_C4) )
268
276
static
inline
Objects_APIs
_Objects_Get_API(
277
Objects_Id
id
278
)
279
{
280
return
(
Objects_APIs
) ((
id
>>
OBJECTS_API_START_BIT
) &
OBJECTS_API_VALID_BITS
);
281
}
282
290
static
inline
uint32_t _Objects_Get_class(
291
Objects_Id
id
292
)
293
{
294
return
(uint32_t)
295
((
id
>>
OBJECTS_CLASS_START_BIT
) &
OBJECTS_CLASS_VALID_BITS
);
296
}
297
305
static
inline
uint32_t _Objects_Get_node(
306
Objects_Id
id
307
)
308
{
309
return
(
id
>>
OBJECTS_NODE_START_BIT
) &
OBJECTS_NODE_VALID_BITS
;
310
}
311
319
static
inline
Objects_Maximum
_Objects_Get_index(
320
Objects_Id
id
321
)
322
{
323
return
324
(
Objects_Maximum
)((
id
>>
OBJECTS_INDEX_START_BIT
) &
325
OBJECTS_INDEX_VALID_BITS
);
326
}
327
338
#define _Objects_Build_id( the_api, the_class, node, index ) \
339
( (Objects_Id) ( (Objects_Id) the_api << OBJECTS_API_START_BIT ) | \
340
( (Objects_Id) the_class << OBJECTS_CLASS_START_BIT ) | \
341
( (Objects_Id) node << OBJECTS_NODE_START_BIT ) | \
342
( (Objects_Id) index << OBJECTS_INDEX_START_BIT ) )
343
352
#define _Objects_Is_unlimited( maximum ) \
353
( ( ( maximum ) & OBJECTS_UNLIMITED_OBJECTS ) != 0 )
354
355
/*
356
* We cannot use an inline function for this since it may be evaluated at
357
* compile time.
358
*/
359
#define _Objects_Maximum_per_allocation( maximum ) \
360
((Objects_Maximum) ((maximum) & ~OBJECTS_UNLIMITED_OBJECTS))
361
365
#if defined(RTEMS_MULTIPROCESSING)
366
extern
uint16_t
_Objects_Local_node
;
367
#else
368
#define _Objects_Local_node ((uint16_t) 1)
369
#endif
370
372
373
#ifdef __cplusplus
374
}
375
#endif
376
377
#endif
378
/* end of include file */
basedefs.h
This header file provides basic definitions used by the API and the implementation.
Objects_APIs
Objects_APIs
Definition
object.h:195
OBJECTS_NODE_START_BIT
#define OBJECTS_NODE_START_BIT
Definition
object.h:118
Objects_Id
uint32_t Objects_Id
Definition
object.h:101
OBJECTS_API_VALID_BITS
#define OBJECTS_API_VALID_BITS
Definition
object.h:168
OBJECTS_CLASS_VALID_BITS
#define OBJECTS_CLASS_VALID_BITS
Definition
object.h:174
OBJECTS_INDEX_START_BIT
#define OBJECTS_INDEX_START_BIT
Definition
object.h:113
OBJECTS_API_START_BIT
#define OBJECTS_API_START_BIT
Definition
object.h:124
OBJECTS_INDEX_VALID_BITS
#define OBJECTS_INDEX_VALID_BITS
Definition
object.h:156
Objects_Maximum
uint16_t Objects_Maximum
Definition
object.h:107
OBJECTS_CLASS_START_BIT
#define OBJECTS_CLASS_START_BIT
Definition
object.h:130
OBJECTS_NODE_VALID_BITS
#define OBJECTS_NODE_VALID_BITS
Definition
object.h:162
_Objects_Local_node
#define _Objects_Local_node
The local MPCI node number.
Definition
object.h:368
Objects_Name
Definition
object.h:85
Objects_Name::name_p
const char * name_p
Definition
object.h:87
Objects_Name::name_u32
uint32_t name_u32
Definition
object.h:89
Generated by
1.18.0