source: rtems/cpukit/score/src/objectgetinfo.c @ f031df0e

4.115
Last change on this file since f031df0e was a2e3f33, checked in by Sebastian Huber <sebastian.huber@…>, on 07/24/13 at 11:50:54

score: Create object implementation header

Move implementation specific parts of object.h and object.inl into new
header file objectimpl.h. The object.h contains now only the
application visible API.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief Get Object Information
5 *  @ingroup ScoreObject
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2008.
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.com/license/LICENSE.
15 */
16
17#ifdef HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/score/objectimpl.h>
22
23Objects_Information *_Objects_Get_information(
24  Objects_APIs   the_api,
25  uint16_t       the_class
26)
27{
28  Objects_Information *info;
29  int the_class_api_maximum;
30
31  if ( !the_class )
32    return NULL;
33
34  /*
35   *  This call implicitly validates the_api so we do not call
36   *  _Objects_Is_api_valid above here.
37   */
38  the_class_api_maximum = _Objects_API_maximum_class( the_api );
39  if ( the_class_api_maximum == 0 )
40    return NULL;
41
42  if ( the_class > (uint32_t) the_class_api_maximum )
43    return NULL;
44
45  if ( !_Objects_Information_table[ the_api ] )
46    return NULL;
47
48  info = _Objects_Information_table[ the_api ][ the_class ];
49  if ( !info )
50    return NULL;
51
52  /*
53   *  In a multprocessing configuration, we may access remote objects.
54   *  Thus we may have 0 local instances and still have a valid object
55   *  pointer.
56   */
57  #if !defined(RTEMS_MULTIPROCESSING)
58    if ( info->maximum == 0 )
59      return NULL;
60  #endif
61
62  return info;
63}
64
Note: See TracBrowser for help on using the repository browser.