source: rtems/c/src/exec/rtems/src/eventmp.c @ 3a4ae6c

4.104.114.84.95
Last change on this file since 3a4ae6c was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/95 at 19:35:39

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

  • Property mode set to 100644
File size: 3.9 KB
Line 
1/*
2 *  Multiprocessing Support for the Event Manager
3 *
4 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
5 *  On-Line Applications Research Corporation (OAR).
6 *  All rights assigned to U.S. Government, 1994.
7 *
8 *  This material may be reproduced by or for the U.S. Government pursuant
9 *  to the copyright license under the clause at DFARS 252.227-7013.  This
10 *  notice must appear in all copies of this file and its derivatives.
11 *
12 *  $Id$
13 */
14
15#include <rtems/system.h>
16#include <rtems/rtems/status.h>
17#include <rtems/rtems/event.h>
18#include <rtems/core/mpci.h>
19#include <rtems/core/mppkt.h>
20#include <rtems/core/object.h>
21#include <rtems/rtems/options.h>
22#include <rtems/core/states.h>
23#include <rtems/core/thread.h>
24#include <rtems/rtems/support.h>
25
26/*PAGE
27 *
28 *  _Event_MP_Send_process_packet
29 *
30 *  This subprogram is not needed since there are no process
31 *  packets to be sent by this manager.
32 *
33 */
34
35/*PAGE
36 *
37 *  _Event_MP_Send_request_packet
38 *
39 */
40
41rtems_status_code _Event_MP_Send_request_packet (
42  Event_MP_Remote_operations operation,
43  Objects_Id                 event_id,
44  rtems_event_set         event_in
45)
46{
47  Event_MP_Packet *the_packet;
48
49  switch ( operation ) {
50
51    case EVENT_MP_SEND_REQUEST:
52
53      the_packet                    = _Event_MP_Get_packet();
54      the_packet->Prefix.the_class  = MP_PACKET_EVENT;
55      the_packet->Prefix.length     = sizeof ( Event_MP_Packet );
56      the_packet->Prefix.to_convert = sizeof ( Event_MP_Packet );
57      the_packet->operation         = operation;
58      the_packet->Prefix.id         = event_id;
59      the_packet->event_in          = event_in;
60
61      return
62        _MPCI_Send_request_packet(
63          rtems_get_node( event_id ),
64          &the_packet->Prefix,
65          STATES_READY
66        );
67
68      break;
69
70    case EVENT_MP_SEND_RESPONSE:
71      break;
72
73  }
74  /*
75   *  The following line is included to satisfy compilers which
76   *  produce warnings when a function does not end with a return.
77   */
78  return RTEMS_SUCCESSFUL;
79}
80
81/*PAGE
82 *
83 *  _Event_MP_Send_response_packet
84 *
85 */
86
87void _Event_MP_Send_response_packet (
88  Event_MP_Remote_operations  operation,
89  Thread_Control             *the_thread
90)
91{
92  Event_MP_Packet *the_packet;
93
94  switch ( operation ) {
95
96    case EVENT_MP_SEND_RESPONSE:
97
98      the_packet = ( Event_MP_Packet *) the_thread->receive_packet;
99
100/*
101 *  The packet being returned already contains the class, length, and
102 *  to_convert fields, therefore they are not set in this routine.
103 */
104      the_packet->operation = operation;
105      the_packet->Prefix.id = the_packet->Prefix.source_tid;
106
107      _MPCI_Send_response_packet(
108        rtems_get_node( the_packet->Prefix.source_tid ),
109        &the_packet->Prefix
110      );
111      break;
112
113    case EVENT_MP_SEND_REQUEST:
114      break;
115
116  }
117}
118
119/*PAGE
120 *
121 *
122 *  _Event_MP_Process_packet
123 *
124 */
125
126void _Event_MP_Process_packet (
127  rtems_packet_prefix  *the_packet_prefix
128)
129{
130  Event_MP_Packet *the_packet;
131  Thread_Control  *the_thread;
132
133  the_packet = (Event_MP_Packet *) the_packet_prefix;
134
135  switch ( the_packet->operation ) {
136
137    case EVENT_MP_SEND_REQUEST:
138
139      the_packet->Prefix.return_code = rtems_event_send(
140        the_packet->Prefix.id,
141        the_packet->event_in
142      );
143
144      _Event_MP_Send_response_packet(
145        EVENT_MP_SEND_RESPONSE,
146        _Thread_Executing
147      );
148      break;
149
150    case EVENT_MP_SEND_RESPONSE:
151
152      the_thread = _MPCI_Process_response( the_packet_prefix );
153
154      _MPCI_Return_packet( the_packet_prefix );
155
156      break;
157
158  }
159}
160
161/*PAGE
162 *
163 *  _Event_MP_Send_object_was_deleted
164 *
165 *  This subprogram is not needed since there are no objects
166 *  deleted by this manager.
167 *
168 */
169
170/*PAGE
171 *
172 *  _Event_MP_Send_extract_proxy
173 *
174 *  This subprogram is not needed since there are no objects
175 *  deleted by this manager.
176 *
177 */
178
179/*PAGE
180 *
181 *  _Event_MP_Get_packet
182 *
183 */
184
185Event_MP_Packet *_Event_MP_Get_packet ( void )
186{
187  return ( (Event_MP_Packet *) _MPCI_Get_packet() );
188}
189
190/* end of file */
Note: See TracBrowser for help on using the repository browser.