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

4.115
Last change on this file since c05d7502 was c05d7502, checked in by Mathew Kallada <matkallada@…>, on 12/02/12 at 22:59:17

score misc: Clean up Doxygen #14 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

http://www.google-melange.com/gci/task/view/google/gci2012/8025204

  • 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/event.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      _Thread_Enable_dispatch();
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.