source: rtems/cpukit/rtems/src/systemeventsend.c @ 66cb142

Last change on this file since 66cb142 was e266d13, checked in by Sebastian Huber <sebastian.huber@…>, on May 20, 2016 at 1:10:27 PM

Replace *_Get_interrupt_disable() with *_Get()

Uniformly use *_Get() to get an object by identifier with a lock
context.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ClassicEventSystem
5 *
6 * @brief rtems_event_system_send() implementation.
7 */
8
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#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  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}
Note: See TracBrowser for help on using the repository browser.