RTEMS
cpukit
rtems
src
systemeventsend.c
Go to the documentation of this file.
1
9
/*
10
* Copyright (c) 2012, 2016 embedded brains GmbH. All rights reserved.
11
*
12
* embedded brains GmbH
13
* Dornierstr. 4
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.org/license/LICENSE.
21
*/
22
23
#ifdef HAVE_CONFIG_H
24
#include "config.h"
25
#endif
26
27
#include <
rtems/rtems/eventimpl.h
>
28
#include <
rtems/rtems/tasksdata.h
>
29
#include <
rtems/score/threadimpl.h
>
30
31
rtems_status_code
rtems_event_system_send
(
32
rtems_id
id
,
33
rtems_event_set
event_in
34
)
35
{
36
Thread_Control
*the_thread;
37
RTEMS_API_Control
*api;
38
ISR_lock_Context
lock_context;
39
40
the_thread =
_Thread_Get
(
id
, &lock_context );
41
42
if
( the_thread == NULL ) {
43
#if defined(RTEMS_MULTIPROCESSING)
44
if
( _Thread_MP_Is_remote(
id
) ) {
45
return
RTEMS_ILLEGAL_ON_REMOTE_OBJECT
;
46
}
47
#endif
48
49
return
RTEMS_INVALID_ID
;
50
}
51
52
api = the_thread->
API_Extensions
[
THREAD_API_RTEMS
];
53
return
_Event_Surrender(
54
the_thread,
55
event_in,
56
&api->
System_event
,
57
THREAD_WAIT_CLASS_SYSTEM_EVENT
,
58
&lock_context
59
);
60
}
RTEMS_API_Control
Definition:
tasksdata.h:41
RTEMS_API_Control::System_event
Event_Control System_event
Definition:
tasksdata.h:45
_Thread_Get
Thread_Control * _Thread_Get(Objects_Id id, ISR_lock_Context *lock_context)
Gets a thread by its identifier.
Definition:
threadget.c:24
eventimpl.h
Classic Event Manager Implementation.
_Thread_Control
Definition:
thread.h:725
rtems_status_code
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition:
status.h:82
_Thread_Control::API_Extensions
void * API_Extensions[THREAD_API_LAST+1]
Definition:
thread.h:840
RTEMS_INVALID_ID
This status code indicates that an object identifier was invalid.
Definition:
status.h:106
rtems_id
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition:
types.h:99
THREAD_API_RTEMS
Definition:
thread.h:584
RTEMS_ILLEGAL_ON_REMOTE_OBJECT
This status code indicates that the operation was illegal on a remote object.
Definition:
status.h:177
threadimpl.h
Inlined Routines from the Thread Handler.
THREAD_WAIT_CLASS_SYSTEM_EVENT
#define THREAD_WAIT_CLASS_SYSTEM_EVENT
Indicates that the thread waits for a system event.
Definition:
threadimpl.h:2178
ISR_lock_Context
Local ISR lock context for acquire and release pairs.
Definition:
isrlock.h:65
rtems_event_set
uint32_t rtems_event_set
This integer type can hold an event set of up to 32 events represented as a bit field.
Definition:
event.h:94
rtems_event_system_send
rtems_status_code rtems_event_system_send(rtems_id id, rtems_event_set event_in)
Sends a system event set to a task.
Definition:
systemeventsend.c:31
tasksdata.h
Classic Tasks Manager Data Structures.
Generated by
1.8.14