source: rtems/cpukit/score/src/objectgetinfo.c @ 749d64a

4.104.115
Last change on this file since 749d64a was 4b4108a4, checked in by Joel Sherrill <joel.sherrill@…>, on 07/08/09 at 17:56:07

2009-07-08 Joel Sherrill <joel.sherrill@…>

  • score/src/objectgetinfo.c: Clean up and eliminate unreachable code.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2008.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <rtems/system.h>
17#include <rtems/score/object.h>
18#include <rtems/score/thread.h>
19#include <rtems/score/wkspace.h>
20
21Objects_Information *_Objects_Get_information(
22  Objects_APIs   the_api,
23  uint32_t       the_class
24)
25{
26  Objects_Information *info;
27  int the_class_api_maximum;
28
29  if ( !the_class )
30    return NULL;
31
32  /*
33   *  This call implicitly validates the_api so we do not call
34   *  _Objects_Is_api_valid above here.
35   */
36  the_class_api_maximum = _Objects_API_maximum_class( the_api );
37  if ( the_class_api_maximum == 0 )
38    return NULL;
39
40  if ( the_class > (uint32_t) the_class_api_maximum )
41    return NULL;
42
43  if ( !_Objects_Information_table[ the_api ] )
44    return NULL;
45
46  info = _Objects_Information_table[ the_api ][ the_class ];
47  if ( !info )
48    return NULL;
49
50  /*
51   *  In a multprocessing configuration, we may access remote objects.
52   *  Thus we may have 0 local instances and still have a valid object
53   *  pointer.
54   */
55  #if !defined(RTEMS_MULTIPROCESSING)
56    if ( info->maximum == 0 )
57      return NULL;
58  #endif
59
60  return info;
61}
62
Note: See TracBrowser for help on using the repository browser.