RTEMS  5.0.0-m2006-1
mpci.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 
14 /*
15  * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
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_CONFDEFS_MPCI_H
40 #define _RTEMS_CONFDEFS_MPCI_H
41 
42 #ifndef __CONFIGURATION_TEMPLATE_h
43 #error "Do not include this file directly, use <rtems/confdefs.h> instead"
44 #endif
45 
46 #ifdef CONFIGURE_INIT
47 
48 #ifdef RTEMS_MULTIPROCESSING
49 
50 #ifdef CONFIGURE_MP_APPLICATION
51 
52 #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
53  #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0
54 #endif
55 
56 #ifndef CONFIGURE_MP_NODE_NUMBER
57  #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER
58 #endif
59 
60 #ifndef CONFIGURE_MP_MAXIMUM_NODES
61  #define CONFIGURE_MP_MAXIMUM_NODES 2
62 #endif
63 
64 #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
65  #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32
66 #endif
67 
68 #ifndef CONFIGURE_MP_MAXIMUM_PROXIES
69  #define CONFIGURE_MP_MAXIMUM_PROXIES 32
70 #endif
71 
72 #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
73  #include <mpci.h>
74 
75  #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table
76 #endif
77 
78 #if CONFIGURE_MP_NODE_NUMBER < 1
79  #error "CONFIGURE_MP_NODE_NUMBER must be greater than or equal to one"
80 #endif
81 
82 #if CONFIGURE_MP_NODE_NUMBER > CONFIGURE_MP_MAXIMUM_NODES
83  #error "CONFIGURE_MP_NODE_NUMBER must be less than or equal to CONFIGURE_MP_MAXIMUM_NODES"
84 #endif
85 
86 #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 1
87 
88 #ifdef __cplusplus
89 extern "C" {
90 #endif
91 
92 Objects_MP_Control _Objects_MP_Controls[
93  CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
94 ];
95 
96 struct Thread_Configured_proxy_control {
97  Thread_Proxy_control Control;
99 };
100 
101 static Thread_Configured_proxy_control _Thread_MP_Configured_proxies[
102  CONFIGURE_MP_MAXIMUM_PROXIES
103 ];
104 
105 Thread_Configured_proxy_control * const _Thread_MP_Proxies =
106  &_Thread_MP_Configured_proxies[ 0 ];
107 
109  CONFIGURE_MP_NODE_NUMBER,
110  CONFIGURE_MP_MAXIMUM_NODES,
111  CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS,
112  CONFIGURE_MP_MAXIMUM_PROXIES,
113  CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK,
114  CONFIGURE_MP_MPCI_TABLE_POINTER
115 };
116 
118  CONFIGURE_MINIMUM_TASK_STACK_SIZE
119  + CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
120  + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK
121  + CPU_ALL_TASKS_ARE_FP * CONTEXT_FP_SIZE
123 RTEMS_SECTION( ".rtemsstack.mpci" );
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #else /* CONFIGURE_MP_APPLICATION */
130 
131 #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0
132 
133 #endif /* CONFIGURE_MP_APPLICATION */
134 
135 #else /* RTEMS_MULTIPROCESSING */
136 
137 #ifdef CONFIGURE_MP_APPLICATION
138  #error "CONFIGURE_MP_APPLICATION must not be defined if multiprocessing is disabled"
139 #endif
140 
141 #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0
142 
143 #endif /* RTEMS_MULTIPROCESSING */
144 
145 #endif /* CONFIGURE_INIT */
146 
147 #endif /* _RTEMS_CONFDEFS_MPCI_H */
#define CONTEXT_FP_SIZE
Size of floating point context area.
Definition: context.h:52
#define RTEMS_ALIGNED(_alignment)
Instructs the compiler to enforce the specified alignment.
Definition: basedefs.h:216
#define CPU_INTERRUPT_STACK_ALIGNMENT
Definition: cpu.h:605
Thread queue heads.
Definition: threadq.h:360
char _MPCI_Receive_server_stack[]
The MPCI receive server stack.
const MPCI_Configuration _MPCI_Configuration
The MPCI configuration.
Definition: mpcidefault.c:32
#define RTEMS_SECTION(_section)
Instructs the compiler to place a specific variable or function in the specified section.
Definition: basedefs.h:154
Definition: thread.h:519
Definition: mpci.h:137