source: rtems/cpukit/rtems/src/signalmp.c @ 3a5dbdc

4.104.114.84.95
Last change on this file since 3a5dbdc was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

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