source: rtems/cpukit/score/src/objectgetnoprotection.c @ fce900b5

5
Last change on this file since fce900b5 was d7a12be9, checked in by Sebastian Huber <sebastian.huber@…>, on 04/19/16 at 12:14:10

score: Optimize _Objects_Get_no_protection()

Make the id the first parameter since usual callers get the object
identifier as the first parameter themself.

  • Property mode set to 100644
File size: 1.0 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief  Get Object without Dispatching Protection
5 *  @ingroup ScoreObject
6 */
7
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#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/score/objectimpl.h>
22
23Objects_Control *_Objects_Get_no_protection(
24  Objects_Id                 id,
25  const Objects_Information *information
26)
27{
28  Objects_Control *the_object;
29  uint32_t         index;
30
31  /*
32   * You can't just extract the index portion or you can get tricked
33   * by a value between 1 and maximum.
34   */
35  index = id - information->minimum_id + 1;
36
37  if ( information->maximum >= index ) {
38    if ( (the_object = information->local_table[ index ]) != NULL ) {
39      return the_object;
40    }
41  }
42
43  /*
44   *  This isn't supported or required yet for Global objects so
45   *  if it isn't local, we don't find it.
46   */
47  return NULL;
48}
Note: See TracBrowser for help on using the repository browser.