OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [rtems/] [src/] [eventsend.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  Event Manager
3
 *
4
 *  COPYRIGHT (c) 1989-1999.
5
 *  On-Line Applications Research Corporation (OAR).
6
 *
7
 *  The license and distribution terms for this file may be
8
 *  found in the file LICENSE in this distribution or at
9
 *  http://www.OARcorp.com/rtems/license.html.
10
 *
11
 *  $Id: eventsend.c,v 1.2 2001-09-27 11:59:19 chris Exp $
12
 */
13
 
14
#include <rtems/system.h>
15
#include <rtems/rtems/status.h>
16
#include <rtems/rtems/event.h>
17
#include <rtems/score/isr.h>
18
#include <rtems/score/object.h>
19
#include <rtems/rtems/options.h>
20
#include <rtems/score/states.h>
21
#include <rtems/score/thread.h>
22
#include <rtems/rtems/tasks.h>
23
 
24
/*PAGE
25
 *
26
 *  rtems_event_send
27
 *
28
 *  This directive allows a thread send an event set to another thread.
29
 *
30
 *  Input parameters:
31
 *    id    - thread id
32
 *    event - event set
33
 *
34
 *  Output parameters:
35
 *    RTEMS_SUCCESSFUL - if successful
36
 *    error code - if unsuccessful
37
 */
38
 
39
rtems_status_code rtems_event_send(
40
  Objects_Id         id,
41
  rtems_event_set event_in
42
)
43
{
44
  register Thread_Control *the_thread;
45
  Objects_Locations        location;
46
  RTEMS_API_Control       *api;
47
 
48
  the_thread = _Thread_Get( id, &location );
49
  switch ( location ) {
50
    case OBJECTS_REMOTE:
51
#if defined(RTEMS_MULTIPROCESSING)
52
      return(
53
        _Event_MP_Send_request_packet(
54
          EVENT_MP_SEND_REQUEST,
55
          id,
56
          event_in
57
        )
58
      );
59
#endif
60
    case OBJECTS_ERROR:
61
      return RTEMS_INVALID_ID;
62
    case OBJECTS_LOCAL:
63
      api = the_thread->API_Extensions[ THREAD_API_RTEMS ];
64
      _Event_sets_Post( event_in, &api->pending_events );
65
      _Event_Surrender( the_thread );
66
      _Thread_Enable_dispatch();
67
      return RTEMS_SUCCESSFUL;
68
  }
69
 
70
  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
71
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.