RTEMS
objectgetnoprotection.c
Go to the documentation of this file.
1 
8 /*
9  * COPYRIGHT (c) 1989-2002.
10  * On-Line Applications Research Corporation (OAR).
11  *
12  * The license and distribution terms for this file may be
13  * found in the file LICENSE in this distribution or at
14  * http://www.rtems.org/license/LICENSE.
15  */
16 
17 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20 
21 #include <rtems/score/objectimpl.h>
22 
24  Objects_Id id,
25  const Objects_Information *information
26 )
27 {
28  Objects_Id delta;
29  Objects_Id maximum_id;
30  Objects_Id end;
31 
32  maximum_id = information->maximum_id;
33  delta = maximum_id - id;
34  end = _Objects_Get_index( maximum_id );
35 
36  if ( RTEMS_PREDICT_TRUE( delta < end ) ) {
37  return information->local_table[ end - OBJECTS_INDEX_MINIMUM - delta ];
38  }
39 
40  /*
41  * This isn't supported or required yet for Global objects so
42  * if it isn't local, we don't find it.
43  */
44  return NULL;
45 }
#define OBJECTS_INDEX_MINIMUM
Definition: objectimpl.h:80
static __inline__ Objects_Maximum _Objects_Get_index(Objects_Id id)
Returns the index portion of the ID.
Definition: object.h:298
Inlined Routines in the Object Handler.
Objects_Id maximum_id
This is the maximum valid ID of this object API class.
Definition: objectdata.h:185
Objects_Control ** local_table
This points to the table of local object control blocks.
Definition: objectdata.h:195
The information structure used to manage each API class of objects.
Definition: objectdata.h:176
uint32_t Objects_Id
Definition: object.h:80
#define RTEMS_PREDICT_TRUE(_exp)
Returns the value of the specified integral expression and tells the compiler that the predicted valu...
Definition: basedefs.h:765
Objects_Control * _Objects_Get_no_protection(Objects_Id id, const Objects_Information *information)
Maps object ids to object control blocks.