source: rtems/cpukit/rtems/src/eventsend.c @ e151eb1

4.115
Last change on this file since e151eb1 was e151eb1, checked in by Sebastian Huber <sebastian.huber@…>, on 07/23/13 at 10:47:35

rtems: Create event implementation header

Move implementation specific parts of event.h, event.inl, eventset.h and
eventset.inl into new header file eventimpl.h. The event.h contains now
only the application visible API.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief Sends an Event Set to the Target Task
5 *  @ingroup ClassicEvent
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2007.
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.com/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18  #include "config.h"
19#endif
20
21#include <rtems/rtems/eventimpl.h>
22#include <rtems/rtems/tasks.h>
23
24rtems_status_code rtems_event_send(
25  rtems_id        id,
26  rtems_event_set event_in
27)
28{
29  rtems_status_code  sc;
30  Thread_Control    *thread;
31  Objects_Locations  location;
32  RTEMS_API_Control *api;
33
34  thread = _Thread_Get( id, &location );
35  switch ( location ) {
36    case OBJECTS_LOCAL:
37      api = thread->API_Extensions[ THREAD_API_RTEMS ];
38      _Event_Surrender(
39        thread,
40        event_in,
41        &api->Event,
42        &_Event_Sync_state,
43        STATES_WAITING_FOR_EVENT
44      );
45      _Objects_Put( &thread->Object );
46      sc = RTEMS_SUCCESSFUL;
47      break;
48#ifdef RTEMS_MULTIPROCESSING
49    case OBJECTS_REMOTE:
50      sc = _Event_MP_Send_request_packet(
51        EVENT_MP_SEND_REQUEST,
52        id,
53        event_in
54      );
55      break;
56#endif
57    default:
58      sc = RTEMS_INVALID_ID;
59      break;
60  }
61
62  return sc;
63}
Note: See TracBrowser for help on using the repository browser.