source: rtems/cpukit/rtems/src/systemeventsend.c @ 5618c37a

4.115
Last change on this file since 5618c37a was 5618c37a, checked in by Sebastian Huber <sebastian.huber@…>, on 07/24/13 at 13:14:48

score: Create thread implementation header

Move implementation specific parts of thread.h and thread.inl into new
header file threadimpl.h. The thread.h contains now only the
application visible API.

Remove superfluous header file includes from various files.

  • 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.com/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.