1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Object Get Isr Disable |
---|
5 | * @ingroup ScoreObject |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-1999. |
---|
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 | |
---|
23 | Objects_Control *_Objects_Get_isr_disable( |
---|
24 | Objects_Information *information, |
---|
25 | Objects_Id id, |
---|
26 | Objects_Locations *location, |
---|
27 | ISR_lock_Context *lock_context |
---|
28 | ) |
---|
29 | { |
---|
30 | Objects_Control *the_object; |
---|
31 | uint32_t index; |
---|
32 | |
---|
33 | index = id - information->minimum_id + 1; |
---|
34 | |
---|
35 | if ( information->maximum >= index ) { |
---|
36 | #if defined(RTEMS_SMP) |
---|
37 | _Thread_Disable_dispatch(); |
---|
38 | #endif |
---|
39 | _ISR_lock_ISR_disable( lock_context ); |
---|
40 | if ( (the_object = information->local_table[ index ]) != NULL ) { |
---|
41 | *location = OBJECTS_LOCAL; |
---|
42 | return the_object; |
---|
43 | } |
---|
44 | _ISR_lock_ISR_enable( lock_context ); |
---|
45 | #if defined(RTEMS_SMP) |
---|
46 | _Thread_Enable_dispatch(); |
---|
47 | #endif |
---|
48 | *location = OBJECTS_ERROR; |
---|
49 | return NULL; |
---|
50 | } |
---|
51 | *location = OBJECTS_ERROR; |
---|
52 | |
---|
53 | #if defined(RTEMS_MULTIPROCESSING) |
---|
54 | _Objects_MP_Is_remote( information, id, location, &the_object ); |
---|
55 | return the_object; |
---|
56 | #else |
---|
57 | return NULL; |
---|
58 | #endif |
---|
59 | } |
---|