4.115
Last change
on this file since 9bfd7ff was
0edf263,
checked in by Sebastian Huber <sebastian.huber@…>, on 10/26/12 at 08:05:07
|
rtems: Add system events
System events are similar to normal events. They offer a second set of
events. These events are intended for internal RTEMS use and should not
be used by applications (with the exception of the transient system
event).
|
-
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 | sc = RTEMS_ILLEGAL_ON_REMOTE_OBJECT; |
---|
57 | break; |
---|
58 | #endif |
---|
59 | default: |
---|
60 | sc = RTEMS_INVALID_ID; |
---|
61 | break; |
---|
62 | } |
---|
63 | |
---|
64 | return sc; |
---|
65 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.