source: rtems/cpukit/rtems/src/signalmp.c @ 6c06288

4.104.114.95
Last change on this file since 6c06288 was 6c06288, checked in by Joel Sherrill <joel.sherrill@…>, on 01/29/08 at 21:52:21

2008-01-29 Joel Sherrill <joel.sherrill@…>

  • itron/src/exd_tsk.c, itron/src/task.c, libmisc/capture/capture.c, libmisc/monitor/mon-config.c, libmisc/monitor/mon-driver.c, libmisc/monitor/mon-itask.c, libmisc/monitor/mon-monitor.c, libmisc/monitor/mon-mpci.c, libmisc/monitor/mon-object.c, libmisc/monitor/mon-symbols.c, posix/src/cancelrun.c, posix/src/pthreadexit.c, rtems/Makefile.am, rtems/preinstall.am, rtems/include/rtems.h, rtems/include/rtems/rtems/support.h, rtems/inline/rtems/rtems/tasks.inl, rtems/src/eventmp.c, rtems/src/msgmp.c, rtems/src/partmp.c, rtems/src/regionmp.c, rtems/src/rtemsobjectgetname.c, rtems/src/semmp.c, rtems/src/signalmp.c, rtems/src/taskdelete.c, rtems/src/taskmp.c, rtems/src/timerserver.c, score/Makefile.am, score/include/rtems/score/object.h, score/inline/rtems/score/object.inl, score/src/Unlimited.txt, score/src/objectgetnameasstring.c, score/src/threadqextractwithproxy.c: Add new Object Services collection. This changed the name of a few previously public but undocumented services and added a some new services.
  • rtems/include/rtems/rtems/object.h, rtems/src/rtemsbuildid.c, rtems/src/rtemsbuildname.c, rtems/src/rtemsobjectapimaximumclass.c, rtems/src/rtemsobjectapiminimumclass.c, rtems/src/rtemsobjectgetapiclassname.c, rtems/src/rtemsobjectgetapiname.c, rtems/src/rtemsobjectgetclassicname.c, rtems/src/rtemsobjectgetclassinfo.c, rtems/src/rtemsobjectidapimaximum.c, rtems/src/rtemsobjectidapiminimum.c, rtems/src/rtemsobjectidgetapi.c, rtems/src/rtemsobjectidgetclass.c, rtems/src/rtemsobjectidgetindex.c, rtems/src/rtemsobjectidgetnode.c, rtems/src/rtemsobjectsetname.c, score/src/objectapimaximumclass.c, score/src/objectgetinfo.c, score/src/objectgetinfoid.c, score/src/objectsetname.c: New files.
  • rtems/src/rtemsidtoname.c: Removed.
  • 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-2008.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/system.h>
20#include <rtems/rtems/status.h>
21#include <rtems/score/mpci.h>
22#include <rtems/score/mppkt.h>
23#include <rtems/score/object.h>
24#include <rtems/rtems/options.h>
25#include <rtems/rtems/signal.h>
26#include <rtems/score/states.h>
27#include <rtems/score/thread.h>
28#include <rtems/score/watchdog.h>
29#include <rtems/rtems/support.h>
30
31/*PAGE
32 *
33 *  _Signal_MP_Send_process_packet
34 *
35 *  This subprogram is not needed since there are no process
36 *  packets to be sent by this manager.
37 *
38 */
39
40/*PAGE
41 *
42 *  _Signal_MP_Send_request_packet
43 *
44 */
45
46rtems_status_code _Signal_MP_Send_request_packet (
47  Signal_MP_Remote_operations operation,
48  Objects_Id                  task_id,
49  rtems_signal_set      signal_in
50)
51{
52  Signal_MP_Packet *the_packet;
53
54  switch ( operation ) {
55
56    case SIGNAL_MP_SEND_REQUEST:
57
58      the_packet                    = _Signal_MP_Get_packet();
59      the_packet->Prefix.the_class  = MP_PACKET_SIGNAL;
60      the_packet->Prefix.length     = sizeof ( Signal_MP_Packet );
61      the_packet->Prefix.to_convert = sizeof ( Signal_MP_Packet );
62      the_packet->operation         = operation;
63      the_packet->Prefix.id         = task_id;
64      the_packet->signal_in         = signal_in;
65
66      return _MPCI_Send_request_packet(
67        _Objects_Get_node( task_id ),
68        &the_packet->Prefix,
69        STATES_READY   /* Not used */
70      );
71      break;
72
73    case SIGNAL_MP_SEND_RESPONSE:
74      break;
75
76  }
77  /*
78   *  The following line is included to satisfy compilers which
79   *  produce warnings when a function does not end with a return.
80   */
81  return RTEMS_INTERNAL_ERROR;
82}
83
84/*PAGE
85 *
86 *  _Signal_MP_Send_response_packet
87 *
88 */
89
90void _Signal_MP_Send_response_packet (
91  Signal_MP_Remote_operations  operation,
92  Thread_Control              *the_thread
93)
94{
95  Signal_MP_Packet *the_packet;
96
97  switch ( operation ) {
98
99    case SIGNAL_MP_SEND_RESPONSE:
100
101      the_packet = ( Signal_MP_Packet *) the_thread->receive_packet;
102
103/*
104 *  The packet being returned already contains the class, length, and
105 *  to_convert fields, therefore they are not set in this routine.
106 */
107      the_packet->operation = operation;
108      the_packet->Prefix.id = the_packet->Prefix.source_tid;
109
110      _MPCI_Send_response_packet(
111        _Objects_Get_node( the_packet->Prefix.source_tid ),
112        &the_packet->Prefix
113      );
114      break;
115
116    case SIGNAL_MP_SEND_REQUEST:
117      break;
118
119  }
120}
121
122/*PAGE
123 *
124 *
125 *  _Signal_MP_Process_packet
126 *
127 */
128
129void _Signal_MP_Process_packet (
130  rtems_packet_prefix  *the_packet_prefix
131)
132{
133  Signal_MP_Packet *the_packet;
134  Thread_Control   *the_thread;
135
136  the_packet = (Signal_MP_Packet *) the_packet_prefix;
137
138  switch ( the_packet->operation ) {
139
140    case SIGNAL_MP_SEND_REQUEST:
141
142      the_packet->Prefix.return_code = rtems_signal_send(
143        the_packet->Prefix.id,
144        the_packet->signal_in
145      );
146
147      _Signal_MP_Send_response_packet(
148        SIGNAL_MP_SEND_RESPONSE,
149        _Thread_Executing
150      );
151      break;
152
153    case SIGNAL_MP_SEND_RESPONSE:
154
155      the_thread = _MPCI_Process_response( the_packet_prefix );
156
157      _MPCI_Return_packet( the_packet_prefix );
158      break;
159
160  }
161}
162
163/*PAGE
164 *
165 *  _Signal_MP_Send_object_was_deleted
166 *
167 *  This subprogram is not needed since there are no objects
168 *  deleted by this manager.
169 *
170 */
171
172/*PAGE
173 *
174 *  _Signal_MP_Send_extract_proxy
175 *
176 *  This subprogram is not needed since there are no objects
177 *  deleted by this manager.
178 *
179 */
180
181/*PAGE
182 *
183 *  _Signal_MP_Get_packet
184 *
185 */
186
187Signal_MP_Packet *_Signal_MP_Get_packet ( void )
188{
189  return ( (Signal_MP_Packet *) _MPCI_Get_packet() );
190}
191
192/* end of file */
Note: See TracBrowser for help on using the repository browser.