4.115
Last change
on this file since 2f49cfdf was
2f49cfdf,
checked in by Sebastian Huber <sebastian.huber@…>, on 06/05/13 at 12:07:32
|
rtems: Fix system event send for remote threads
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup ClassicEventSystem |
---|
5 | * |
---|
6 | * @brief rtems_event_system_send() implementation. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2012 embedded brains GmbH. All rights reserved. |
---|
11 | * |
---|
12 | * embedded brains GmbH |
---|
13 | * Obere Lagerstr. 30 |
---|
14 | * 82178 Puchheim |
---|
15 | * Germany |
---|
16 | * <rtems@embedded-brains.de> |
---|
17 | * |
---|
18 | * The license and distribution terms for this file may be |
---|
19 | * found in the file LICENSE in this distribution or at |
---|
20 | * http://www.rtems.com/license/LICENSE. |
---|
21 | */ |
---|
22 | |
---|
23 | #if HAVE_CONFIG_H |
---|
24 | #include "config.h" |
---|
25 | #endif |
---|
26 | |
---|
27 | #include <rtems/rtems/event.h> |
---|
28 | #include <rtems/rtems/tasks.h> |
---|
29 | |
---|
30 | rtems_status_code rtems_event_system_send( |
---|
31 | rtems_id id, |
---|
32 | rtems_event_set event_in |
---|
33 | ) |
---|
34 | { |
---|
35 | rtems_status_code sc; |
---|
36 | Thread_Control *thread; |
---|
37 | Objects_Locations location; |
---|
38 | RTEMS_API_Control *api; |
---|
39 | |
---|
40 | thread = _Thread_Get( id, &location ); |
---|
41 | switch ( location ) { |
---|
42 | case OBJECTS_LOCAL: |
---|
43 | api = thread->API_Extensions[ THREAD_API_RTEMS ]; |
---|
44 | _Event_Surrender( |
---|
45 | thread, |
---|
46 | event_in, |
---|
47 | &api->System_event, |
---|
48 | &_System_event_Sync_state, |
---|
49 | STATES_WAITING_FOR_SYSTEM_EVENT |
---|
50 | ); |
---|
51 | _Thread_Enable_dispatch(); |
---|
52 | sc = RTEMS_SUCCESSFUL; |
---|
53 | break; |
---|
54 | #ifdef RTEMS_MULTIPROCESSING |
---|
55 | case OBJECTS_REMOTE: |
---|
56 | _Thread_Dispatch(); |
---|
57 | sc = RTEMS_ILLEGAL_ON_REMOTE_OBJECT; |
---|
58 | break; |
---|
59 | #endif |
---|
60 | default: |
---|
61 | sc = RTEMS_INVALID_ID; |
---|
62 | break; |
---|
63 | } |
---|
64 | |
---|
65 | return sc; |
---|
66 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.