RTEMS
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 
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 ) ) {
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,
58  &lock_context
59  );
60 }
Event_Control System_event
Definition: tasksdata.h:45
Thread_Control * _Thread_Get(Objects_Id id, ISR_lock_Context *lock_context)
Gets a thread by its identifier.
Definition: threadget.c:24
Classic Event Manager Implementation.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
void * API_Extensions[THREAD_API_LAST+1]
Definition: thread.h:840
This status code indicates that an object identifier was invalid.
Definition: status.h:106
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition: types.h:99
This status code indicates that the operation was illegal on a remote object.
Definition: status.h:177
Inlined Routines from the Thread Handler.
#define THREAD_WAIT_CLASS_SYSTEM_EVENT
Indicates that the thread waits for a system event.
Definition: threadimpl.h:2178
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
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_status_code rtems_event_system_send(rtems_id id, rtems_event_set event_in)
Sends a system event set to a task.
Classic Tasks Manager Data Structures.