source: rtems/c/src/exec/rtems/src/signalmp.c @ b1b5a7cb

4.104.114.84.95
Last change on this file since b1b5a7cb was 5e9b32b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/26/95 at 19:27:15

posix support initially added

  • Property mode set to 100644
File size: 4.0 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/rtems/status.h>
18#include <rtems/score/mpci.h>
19#include <rtems/score/mppkt.h>
20#include <rtems/score/object.h>
21#include <rtems/rtems/options.h>
22#include <rtems/rtems/signal.h>
23#include <rtems/score/states.h>
24#include <rtems/score/thread.h>
25#include <rtems/score/watchdog.h>
26#include <rtems/rtems/support.h>
27
28/*PAGE
29 *
30 *  _Signal_MP_Send_process_packet
31 *
32 *  This subprogram is not needed since there are no process
33 *  packets to be sent by this manager.
34 *
35 */
36
37/*PAGE
38 *
39 *  _Signal_MP_Send_request_packet
40 *
41 */
42
43rtems_status_code _Signal_MP_Send_request_packet (
44  Signal_MP_Remote_operations operation,
45  Objects_Id                  task_id,
46  rtems_signal_set      signal_in
47)
48{
49  Signal_MP_Packet *the_packet;
50
51  switch ( operation ) {
52
53    case SIGNAL_MP_SEND_REQUEST:
54
55      the_packet                    = _Signal_MP_Get_packet();
56      the_packet->Prefix.the_class  = MP_PACKET_SIGNAL;
57      the_packet->Prefix.length     = sizeof ( Signal_MP_Packet );
58      the_packet->Prefix.to_convert = sizeof ( Signal_MP_Packet );
59      the_packet->operation         = operation;
60      the_packet->Prefix.id         = task_id;
61      the_packet->signal_in         = signal_in;
62
63      return _MPCI_Send_request_packet(
64        rtems_get_node( task_id ),
65        &the_packet->Prefix,
66        STATES_READY   /* Not used */
67      );
68      break;
69
70    case SIGNAL_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_INTERNAL_ERROR;
79}
80
81/*PAGE
82 *
83 *  _Signal_MP_Send_response_packet
84 *
85 */
86
87void _Signal_MP_Send_response_packet (
88  Signal_MP_Remote_operations  operation,
89  Thread_Control              *the_thread
90)
91{
92  Signal_MP_Packet *the_packet;
93
94  switch ( operation ) {
95
96    case SIGNAL_MP_SEND_RESPONSE:
97
98      the_packet = ( Signal_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 SIGNAL_MP_SEND_REQUEST:
114      break;
115
116  }
117}
118
119/*PAGE
120 *
121 *
122 *  _Signal_MP_Process_packet
123 *
124 */
125
126void _Signal_MP_Process_packet (
127  rtems_packet_prefix  *the_packet_prefix
128)
129{
130  Signal_MP_Packet *the_packet;
131  Thread_Control   *the_thread;
132
133  the_packet = (Signal_MP_Packet *) the_packet_prefix;
134
135  switch ( the_packet->operation ) {
136
137    case SIGNAL_MP_SEND_REQUEST:
138
139      the_packet->Prefix.return_code = rtems_signal_send(
140        the_packet->Prefix.id,
141        the_packet->signal_in
142      );
143
144      _Signal_MP_Send_response_packet(
145        SIGNAL_MP_SEND_RESPONSE,
146        _Thread_Executing
147      );
148      break;
149
150    case SIGNAL_MP_SEND_RESPONSE:
151
152      the_thread = _MPCI_Process_response( the_packet_prefix );
153
154      _MPCI_Return_packet( the_packet_prefix );
155      break;
156
157  }
158}
159
160/*PAGE
161 *
162 *  _Signal_MP_Send_object_was_deleted
163 *
164 *  This subprogram is not needed since there are no objects
165 *  deleted by this manager.
166 *
167 */
168
169/*PAGE
170 *
171 *  _Signal_MP_Send_extract_proxy
172 *
173 *  This subprogram is not needed since there are no objects
174 *  deleted by this manager.
175 *
176 */
177
178/*PAGE
179 *
180 *  _Signal_MP_Get_packet
181 *
182 */
183
184Signal_MP_Packet *_Signal_MP_Get_packet ( void )
185{
186  return ( (Signal_MP_Packet *) _MPCI_Get_packet() );
187}
188
189/* end of file */
Note: See TracBrowser for help on using the repository browser.