source: rtems/cpukit/include/rtems/score/mpci.h

Last change on this file was c15132aa, checked in by Sebastian Huber <sebastian.huber@…>, on 10/20/23 at 09:09:42

mpci: Hide implementation details

This improves the standard compatibility of API headers. It fixes
errors like this if RTEMS_MULTIPROCESSING is enabled:

cpukit/include/rtems/score/processormask.h: In function 'uint32_t _Processor_mask_Find_last_set(const Processor_mask*)':
cpukit/include/rtems/score/processormask.h:339:21: error: 'flsl' was not declared in this scope

339 | return (uint32_t) BIT_FLS( CPU_MAXIMUM_PROCESSORS, a );

|

  • Property mode set to 100644
File size: 6.5 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 * @file
5 *
6 * @ingroup RTEMSScoreMPCI
7 *
8 * @brief This header file provides interfaces of the
9 *   @ref RTEMSScoreMPCI which are used by the implementation and the
10 *   @ref RTEMSImplApplConfig.
11 */
12
13/*
14 *  COPYRIGHT (c) 1989-2009.
15 *  On-Line Applications Research Corporation (OAR).
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 *    notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 *    notice, this list of conditions and the following disclaimer in the
24 *    documentation and/or other materials provided with the distribution.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39#ifndef _RTEMS_SCORE_MPCI_H
40#define _RTEMS_SCORE_MPCI_H
41
42#include <rtems/score/mppkt.h>
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48/**
49 * @defgroup RTEMSScoreMPCI MPCI Handler
50 *
51 * @ingroup RTEMSScore
52 *
53 * @brief This group contains the MPCI Handler implementation.
54 *
55 * The MPCI Handler encapsulates functionality which is related to the
56 * generation, receipt, and processing of remote operations in a
57 * multiprocessor system.  This handler contains the message passing
58 * support for making remote service calls as well as the server thread
59 * which processes requests from remote nodes.
60 *
61 * @{
62 */
63
64/**
65 *  The following defines the node number used when a broadcast is desired.
66 */
67#define MPCI_ALL_NODES 0
68
69/**
70 *  This type is returned by all user provided MPCI routines.
71 */
72typedef void MPCI_Entry;
73
74/**
75 *  This type defines the prototype for the initization entry point
76 *  in an Multiprocessor Communications Interface.
77 */
78typedef MPCI_Entry ( *MPCI_initialization_entry )( void );
79
80/**
81 *  This type defines the prototype for the get packet entry point
82 *  in an Multiprocessor Communications Interface.  The single
83 *  parameter will point to the packet allocated.
84 */
85typedef MPCI_Entry ( *MPCI_get_packet_entry )(
86                     MP_packet_Prefix **
87                   );
88
89/**
90 *  This type defines the prototype for the return packet entry point
91 *  in an Multiprocessor Communications Interface.  The single
92 *  parameter will point to a packet previously allocated by the
93 *  get packet MPCI entry.
94 */
95typedef MPCI_Entry ( *MPCI_return_packet_entry )(
96                     MP_packet_Prefix *
97                   );
98
99/**
100 *  This type defines the prototype for send get packet entry point
101 *  in an Multiprocessor Communications Interface.  The single
102 *  parameter will point to a packet previously allocated by the
103 *  get packet entry point that has been filled in by the caller.
104 */
105typedef MPCI_Entry ( *MPCI_send_entry )(
106                     uint32_t,
107                     MP_packet_Prefix *
108                   );
109
110/**
111 *  This type defines the prototype for the receive packet entry point
112 *  in an Multiprocessor Communications Interface.  The single
113 *  parameter will point to a packet allocated and filled in by the
114 *  receive packet handler.  The caller will block until a packet is
115 *  received.
116 */
117typedef MPCI_Entry ( *MPCI_receive_entry )(
118                     MP_packet_Prefix **
119                   );
120
121/**
122 *  This type defines the Multiprocessor Communications
123 *  Interface (MPCI) Table.  This table defines the user-provided
124 *  MPCI which is a required part of a multiprocessor system.
125 *
126 *  For non-blocking local operations that become remote operations,
127 *  we need a timeout.  This is a per-driver timeout: default_timeout
128 */
129typedef struct {
130  /** This fields contains the timeout for MPCI operations in ticks. */
131  uint32_t                   default_timeout;
132  /** This field contains the maximum size of a packet supported by this
133   *  MPCI layer.  This size places a limit on the size of a message
134   *  which can be transmitted over this interface.
135   **/
136  size_t                     maximum_packet_size;
137  /** This field points to the MPCI initialization entry point. */
138  MPCI_initialization_entry  initialization;
139  /** This field points to the MPCI get packet entry point. */
140  MPCI_get_packet_entry      get_packet;
141  /** This field points to the MPCI return packet entry point. */
142  MPCI_return_packet_entry   return_packet;
143  /** This field points to the MPCI send packet entry point. */
144  MPCI_send_entry            send_packet;
145  /** This field points to the MPCI receive packet entry point. */
146  MPCI_receive_entry         receive_packet;
147} MPCI_Control;
148
149/*
150 *  The following records define the Multiprocessor Configuration
151 *  Table.  This table defines the multiprocessor system
152 *  characteristics which must be known by RTEMS in a multiprocessor
153 *  system.
154 */
155typedef struct {
156  /** This is the local node number. */
157  uint32_t            node;
158  /** This is the maximum number of nodes in system. */
159  uint32_t            maximum_nodes;
160  /** This is the maximum number of global objects. */
161  uint32_t            maximum_global_objects;
162  /** This is the maximum number of proxies. */
163  uint32_t            maximum_proxies;
164
165  /**
166   * The MPCI Receive server is assumed to have a stack of at least
167   * minimum stack size.  This field specifies the amount of extra
168   * stack this task will be given in bytes.
169   */
170  uint32_t            extra_mpci_receive_server_stack;
171
172  /** This is a pointer to User/BSP provided MPCI Table. */
173  MPCI_Control       *User_mpci_table;
174} MPCI_Configuration;
175
176/**
177 * @brief The MPCI configuration.
178 *
179 * Provided by the application via <rtems/confdefs.h>.
180 */
181extern const MPCI_Configuration _MPCI_Configuration;
182
183/**
184 * @brief The MPCI receive server stack.
185 *
186 * Provided by the application via <rtems/confdefs.h>
187 */
188extern char _MPCI_Receive_server_stack[];
189
190/** @} */
191
192#ifdef __cplusplus
193}
194#endif
195
196#endif
197/* end of include file */
Note: See TracBrowser for help on using the repository browser.