1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
---|
2 | |
---|
3 | /** |
---|
4 | * @file |
---|
5 | * |
---|
6 | * @ingroup RTEMSImplClassicPartitionMP |
---|
7 | * |
---|
8 | * @brief This header file provides the implementation interfaces of the |
---|
9 | * @ref RTEMSImplClassicPartitionMP. |
---|
10 | */ |
---|
11 | |
---|
12 | /* COPYRIGHT (c) 1989-2013. |
---|
13 | * On-Line Applications Research Corporation (OAR). |
---|
14 | * |
---|
15 | * Redistribution and use in source and binary forms, with or without |
---|
16 | * modification, are permitted provided that the following conditions |
---|
17 | * are met: |
---|
18 | * 1. Redistributions of source code must retain the above copyright |
---|
19 | * notice, this list of conditions and the following disclaimer. |
---|
20 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
21 | * notice, this list of conditions and the following disclaimer in the |
---|
22 | * documentation and/or other materials provided with the distribution. |
---|
23 | * |
---|
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
---|
28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
34 | * POSSIBILITY OF SUCH DAMAGE. |
---|
35 | */ |
---|
36 | |
---|
37 | #ifndef _RTEMS_RTEMS_PARTMP_H |
---|
38 | #define _RTEMS_RTEMS_PARTMP_H |
---|
39 | |
---|
40 | #ifndef _RTEMS_RTEMS_PARTIMPL_H |
---|
41 | # error "Never use <rtems/rtems/partmp.h> directly; include <rtems/rtems/partimpl.h> instead." |
---|
42 | #endif |
---|
43 | |
---|
44 | #include <rtems/score/mpciimpl.h> |
---|
45 | |
---|
46 | #ifdef __cplusplus |
---|
47 | extern "C" { |
---|
48 | #endif |
---|
49 | |
---|
50 | /** |
---|
51 | * @defgroup RTEMSImplClassicPartitionMP \ |
---|
52 | * Partition Manager Multiprocessing (MP) Support |
---|
53 | * |
---|
54 | * @ingroup RTEMSImplClassicPartition |
---|
55 | * |
---|
56 | * @brief This group contains the implementation to support the Partition Manager |
---|
57 | * in multiprocessing (MP) configurations. |
---|
58 | * |
---|
59 | * @{ |
---|
60 | */ |
---|
61 | |
---|
62 | /** |
---|
63 | * The following enumerated type defines the list of |
---|
64 | * remote partition operations. |
---|
65 | */ |
---|
66 | typedef enum { |
---|
67 | PARTITION_MP_ANNOUNCE_CREATE = 0, |
---|
68 | PARTITION_MP_ANNOUNCE_DELETE = 1, |
---|
69 | PARTITION_MP_EXTRACT_PROXY = 2, |
---|
70 | PARTITION_MP_GET_BUFFER_REQUEST = 3, |
---|
71 | PARTITION_MP_GET_BUFFER_RESPONSE = 4, |
---|
72 | PARTITION_MP_RETURN_BUFFER_REQUEST = 5, |
---|
73 | PARTITION_MP_RETURN_BUFFER_RESPONSE = 6 |
---|
74 | } Partition_MP_Remote_operations; |
---|
75 | |
---|
76 | /** |
---|
77 | * The following data structure defines the packet used to perform |
---|
78 | * remote partition operations. |
---|
79 | */ |
---|
80 | typedef struct { |
---|
81 | rtems_packet_prefix Prefix; |
---|
82 | Partition_MP_Remote_operations operation; |
---|
83 | rtems_name name; |
---|
84 | void *buffer; |
---|
85 | Objects_Id proxy_id; |
---|
86 | } Partition_MP_Packet; |
---|
87 | |
---|
88 | static inline bool _Partition_MP_Is_remote( Objects_Id id ) |
---|
89 | { |
---|
90 | return _Objects_MP_Is_remote( id, &_Partition_Information ); |
---|
91 | } |
---|
92 | |
---|
93 | /** |
---|
94 | * @brief Partition_MP_Send_process_packet |
---|
95 | * |
---|
96 | * Multiprocessing Support for the Partition Manager |
---|
97 | * |
---|
98 | * This routine performs a remote procedure call so that a |
---|
99 | * process operation can be performed on another node. |
---|
100 | */ |
---|
101 | void _Partition_MP_Send_process_packet ( |
---|
102 | Partition_MP_Remote_operations operation, |
---|
103 | Objects_Id partition_id, |
---|
104 | rtems_name name, |
---|
105 | Objects_Id proxy_id |
---|
106 | ); |
---|
107 | |
---|
108 | /** |
---|
109 | * @brief Issues a remote rtems_partition_get_buffer() request. |
---|
110 | */ |
---|
111 | rtems_status_code _Partition_MP_Get_buffer( |
---|
112 | rtems_id id, |
---|
113 | void **buffer |
---|
114 | ); |
---|
115 | |
---|
116 | /** |
---|
117 | * @brief Issues a remote rtems_partition_return_buffer() request. |
---|
118 | */ |
---|
119 | rtems_status_code _Partition_MP_Return_buffer( |
---|
120 | rtems_id id, |
---|
121 | void *buffer |
---|
122 | ); |
---|
123 | |
---|
124 | /* |
---|
125 | * @brief Partition_MP_Send_object_was_deleted |
---|
126 | * |
---|
127 | * This routine is invoked indirectly by the thread queue |
---|
128 | * when a proxy has been removed from the thread queue and |
---|
129 | * the remote node must be informed of this. |
---|
130 | * |
---|
131 | * This routine is not needed by the Partition since a partition |
---|
132 | * cannot be deleted when buffers are in use. |
---|
133 | */ |
---|
134 | |
---|
135 | #ifdef __cplusplus |
---|
136 | } |
---|
137 | #endif |
---|
138 | |
---|
139 | /**@}*/ |
---|
140 | |
---|
141 | #endif |
---|
142 | /* end of file */ |
---|