source: rtems/cpukit/rtems/src/signalmp.c @ e38a92b

5
Last change on this file since e38a92b was e38a92b, checked in by Sebastian Huber <sebastian.huber@…>, on 05/02/16 at 04:30:49

mpci: Make _*_MP_Get_packet() static

  • Property mode set to 100644
File size: 3.6 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief Signal MP Support
5 *  @ingroup ClassicSignalMP
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2008.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/rtems/signalimpl.h>
22#include <rtems/rtems/optionsimpl.h>
23#include <rtems/score/statesimpl.h>
24#include <rtems/score/threadimpl.h>
25#include <rtems/score/threadqimpl.h>
26
27RTEMS_STATIC_ASSERT(
28  sizeof(Signal_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE,
29  Signal_MP_Packet
30);
31
32static Signal_MP_Packet *_Signal_MP_Get_packet( void )
33{
34  return (Signal_MP_Packet *) _MPCI_Get_packet();
35}
36
37/*
38 *  _Signal_MP_Send_process_packet
39 *
40 *  This subprogram is not needed since there are no process
41 *  packets to be sent by this manager.
42 *
43 */
44
45rtems_status_code _Signal_MP_Send_request_packet (
46  Signal_MP_Remote_operations operation,
47  Objects_Id                  task_id,
48  rtems_signal_set            signal_in
49)
50{
51  Signal_MP_Packet *the_packet;
52
53  switch ( operation ) {
54
55    case SIGNAL_MP_SEND_REQUEST:
56
57      the_packet                    = _Signal_MP_Get_packet();
58      the_packet->Prefix.the_class  = MP_PACKET_SIGNAL;
59      the_packet->Prefix.length     = sizeof ( Signal_MP_Packet );
60      the_packet->Prefix.to_convert = sizeof ( Signal_MP_Packet );
61      the_packet->operation         = operation;
62      the_packet->Prefix.id         = task_id;
63      the_packet->signal_in         = signal_in;
64
65      return _MPCI_Send_request_packet(
66        _Objects_Get_node( task_id ),
67        &the_packet->Prefix,
68        STATES_READY,  /* Not used */
69        RTEMS_TIMEOUT
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
84static void _Signal_MP_Send_response_packet (
85  Signal_MP_Remote_operations  operation,
86  Thread_Control              *the_thread
87)
88{
89  Signal_MP_Packet *the_packet;
90
91  switch ( operation ) {
92
93    case SIGNAL_MP_SEND_RESPONSE:
94
95      the_packet = ( Signal_MP_Packet *) the_thread->receive_packet;
96
97/*
98 *  The packet being returned already contains the class, length, and
99 *  to_convert fields, therefore they are not set in this routine.
100 */
101      the_packet->operation = operation;
102      the_packet->Prefix.id = the_packet->Prefix.source_tid;
103
104      _MPCI_Send_response_packet(
105        _Objects_Get_node( the_packet->Prefix.source_tid ),
106        &the_packet->Prefix
107      );
108      break;
109
110    case SIGNAL_MP_SEND_REQUEST:
111      break;
112
113  }
114}
115
116void _Signal_MP_Process_packet (
117  rtems_packet_prefix  *the_packet_prefix
118)
119{
120  Signal_MP_Packet *the_packet;
121
122  the_packet = (Signal_MP_Packet *) the_packet_prefix;
123
124  switch ( the_packet->operation ) {
125
126    case SIGNAL_MP_SEND_REQUEST:
127
128      the_packet->Prefix.return_code = rtems_signal_send(
129        the_packet->Prefix.id,
130        the_packet->signal_in
131      );
132
133      _Signal_MP_Send_response_packet(
134        SIGNAL_MP_SEND_RESPONSE,
135        _Thread_Executing
136      );
137      break;
138
139    case SIGNAL_MP_SEND_RESPONSE:
140
141      _MPCI_Process_response( the_packet_prefix );
142      _MPCI_Return_packet( the_packet_prefix );
143      break;
144
145  }
146}
147
148/*
149 *  _Signal_MP_Send_object_was_deleted
150 *
151 *  This subprogram is not needed since there are no objects
152 *  deleted by this manager.
153 *
154 */
155
156/*
157 *  _Signal_MP_Send_extract_proxy
158 *
159 *  This subprogram is not needed since there are no objects
160 *  deleted by this manager.
161 *
162 */
163
164/* end of file */
Note: See TracBrowser for help on using the repository browser.