source: rtems/cpukit/rtems/src/systemeventsend.c @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.4 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.org/license/LICENSE.
21 */
22
23#if HAVE_CONFIG_H
24  #include "config.h"
25#endif
26
27#include <rtems/rtems/eventimpl.h>
28#include <rtems/rtems/tasks.h>
29#include <rtems/score/threadimpl.h>
30
31rtems_status_code rtems_event_system_send(
32  rtems_id        id,
33  rtems_event_set event_in
34)
35{
36  rtems_status_code  sc;
37  Thread_Control    *thread;
38  Objects_Locations  location;
39  RTEMS_API_Control *api;
40
41  thread = _Thread_Get( id, &location );
42  switch ( location ) {
43    case OBJECTS_LOCAL:
44      api = thread->API_Extensions[ THREAD_API_RTEMS ];
45      _Event_Surrender(
46        thread,
47        event_in,
48        &api->System_event,
49        &_System_event_Sync_state,
50        STATES_WAITING_FOR_SYSTEM_EVENT
51      );
52      _Objects_Put( &thread->Object );
53      sc = RTEMS_SUCCESSFUL;
54      break;
55#ifdef RTEMS_MULTIPROCESSING
56    case OBJECTS_REMOTE:
57      _Thread_Dispatch();
58      sc = RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
59      break;
60#endif
61    default:
62      sc = RTEMS_INVALID_ID;
63      break;
64  }
65
66  return sc;
67}
Note: See TracBrowser for help on using the repository browser.