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

4.104.114.95
Last change on this file since cdf42cd9 was cdf42cd9, checked in by Joel Sherrill <joel.sherrill@…>, on 09/05/08 at 21:37:20

2008-09-05 Joel Sherrill <joel.sherrill@…>

  • score/src/objectgetinfo.c: Correct for multiprocessor systems when all object instances within a particular class are remote.
  • Property mode set to 100644
File size: 1.3 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 ( !_Objects_Is_api_valid( the_api ) )
30    return NULL;
31
32  if ( !the_class )
33    return NULL;
34
35  the_class_api_maximum = _Objects_API_maximum_class( the_api );
36  if ( the_class_api_maximum < 0 ||
37       the_class > (uint32_t) the_class_api_maximum )
38    return NULL;
39
40  if ( !_Objects_Information_table[ the_api ] )
41    return NULL;
42
43  info = _Objects_Information_table[ the_api ][ the_class ];
44  if ( !info )
45    return NULL;
46
47  /*
48   *  In a multprocessing configuration, we may access remote objects.
49   *  Thus we may have 0 local instances and still have a valid object
50   *  pointer.
51   */
52  #if !defined(RTEMS_MULTIPROCESSING)
53    if ( info->maximum == 0 )
54      return NULL;
55  #endif
56
57  return info;
58}
59
Note: See TracBrowser for help on using the repository browser.