source: rtems/cpukit/score/src/objectnametoid.c @ 2d7ae960

4.115
Last change on this file since 2d7ae960 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*
2 *  Object Handler
3 *
4 *  COPYRIGHT (c) 1989-2010.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <rtems/system.h>
17#include <rtems/score/address.h>
18#include <rtems/score/chain.h>
19#include <rtems/score/object.h>
20#if defined(RTEMS_MULTIPROCESSING)
21#include <rtems/score/objectmp.h>
22#endif
23#include <rtems/score/thread.h>
24#include <rtems/score/wkspace.h>
25#include <rtems/score/sysstate.h>
26#include <rtems/score/isr.h>
27
28/*
29 *  _Objects_Name_to_id_u32
30 *
31 *  These kernel routines search the object table(s) for the given
32 *  object name and returns the associated object id.
33 *
34 *  Input parameters:
35 *    information - object information
36 *    name        - user defined object name
37 *    node        - node indentifier (0 indicates any node)
38 *    id          - address of return ID
39 *
40 *  Output parameters:
41 *    id                                   - object id
42 *    OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL - if successful
43 *    error code                           - if unsuccessful
44 */
45
46Objects_Name_or_id_lookup_errors _Objects_Name_to_id_u32(
47  Objects_Information *information,
48  uint32_t             name,
49  uint32_t             node,
50  Objects_Id          *id
51)
52{
53  bool                       search_local_node;
54  Objects_Control           *the_object;
55  uint32_t                   index;
56#if defined(RTEMS_MULTIPROCESSING)
57  Objects_Name               name_for_mp;
58#endif
59
60  /* ASSERT: information->is_string == false */
61
62  if ( !id )
63    return OBJECTS_INVALID_ADDRESS;
64
65  if ( name == 0 )
66    return OBJECTS_INVALID_NAME;
67
68  search_local_node = false;
69
70  if ( information->maximum != 0 &&
71      (node == OBJECTS_SEARCH_ALL_NODES ||
72       node == OBJECTS_SEARCH_LOCAL_NODE ||
73       _Objects_Is_local_node( node )
74      ))
75   search_local_node = true;
76
77  if ( search_local_node ) {
78    for ( index = 1; index <= information->maximum; index++ ) {
79      the_object = information->local_table[ index ];
80      if ( !the_object )
81        continue;
82
83      if ( name == the_object->name.name_u32 ) {
84        *id = the_object->id;
85        return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL;
86      }
87    }
88  }
89
90#if defined(RTEMS_MULTIPROCESSING)
91  if ( _Objects_Is_local_node( node ) || node == OBJECTS_SEARCH_LOCAL_NODE )
92    return OBJECTS_INVALID_NAME;
93
94  name_for_mp.name_u32 = name;
95  return _Objects_MP_Global_name_search( information, name_for_mp, node, id );
96#else
97  return OBJECTS_INVALID_NAME;
98#endif
99}
Note: See TracBrowser for help on using the repository browser.