5
Last change
on this file since 21275b58 was
9c9c6a9,
checked in by Sebastian Huber <sebastian.huber@…>, on 11/21/18 at 16:30:52
|
score: Remove Objects_Information::is_string
Use Objects_Information::name_length to store this information.
Update #3621.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | /* |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Object id to name |
---|
5 | * @ingroup Score |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2003. |
---|
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/threadimpl.h> |
---|
22 | |
---|
23 | Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( |
---|
24 | Objects_Id id, |
---|
25 | Objects_Name *name |
---|
26 | ) |
---|
27 | { |
---|
28 | Objects_Id tmpId; |
---|
29 | Objects_Information *information; |
---|
30 | Objects_Control *the_object; |
---|
31 | ISR_lock_Context lock_context; |
---|
32 | |
---|
33 | /* |
---|
34 | * Caller is trusted for name != NULL. |
---|
35 | */ |
---|
36 | |
---|
37 | tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Get_executing()->Object.id : id; |
---|
38 | |
---|
39 | information = _Objects_Get_information_id( tmpId ); |
---|
40 | if ( !information ) |
---|
41 | return OBJECTS_INVALID_ID; |
---|
42 | |
---|
43 | if ( _Objects_Has_string_name( information ) ) |
---|
44 | return OBJECTS_INVALID_ID; |
---|
45 | |
---|
46 | the_object = _Objects_Get( |
---|
47 | tmpId, |
---|
48 | &lock_context, |
---|
49 | information |
---|
50 | ); |
---|
51 | if ( !the_object ) |
---|
52 | return OBJECTS_INVALID_ID; |
---|
53 | |
---|
54 | *name = the_object->name; |
---|
55 | _ISR_lock_ISR_enable( &lock_context ); |
---|
56 | return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; |
---|
57 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.