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.com/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <rtems/system.h> |
---|
22 | #include <rtems/score/address.h> |
---|
23 | #include <rtems/score/chain.h> |
---|
24 | #include <rtems/score/object.h> |
---|
25 | #if defined(RTEMS_MULTIPROCESSING) |
---|
26 | #include <rtems/score/objectmp.h> |
---|
27 | #endif |
---|
28 | #include <rtems/score/thread.h> |
---|
29 | #include <rtems/score/wkspace.h> |
---|
30 | #include <rtems/score/sysstate.h> |
---|
31 | #include <rtems/score/isr.h> |
---|
32 | |
---|
33 | Objects_Control *_Objects_Get_no_protection( |
---|
34 | Objects_Information *information, |
---|
35 | Objects_Id id, |
---|
36 | Objects_Locations *location |
---|
37 | ) |
---|
38 | { |
---|
39 | Objects_Control *the_object; |
---|
40 | uint32_t index; |
---|
41 | |
---|
42 | /* |
---|
43 | * You can't just extract the index portion or you can get tricked |
---|
44 | * by a value between 1 and maximum. |
---|
45 | */ |
---|
46 | index = id - information->minimum_id + 1; |
---|
47 | |
---|
48 | if ( information->maximum >= index ) { |
---|
49 | if ( (the_object = information->local_table[ index ]) != NULL ) { |
---|
50 | *location = OBJECTS_LOCAL; |
---|
51 | return the_object; |
---|
52 | } |
---|
53 | } |
---|
54 | |
---|
55 | /* |
---|
56 | * This isn't supported or required yet for Global objects so |
---|
57 | * if it isn't local, we don't find it. |
---|
58 | */ |
---|
59 | *location = OBJECTS_ERROR; |
---|
60 | return NULL; |
---|
61 | } |
---|