RTEMS: cpukit/include/rtems/confdefs/mpci.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
mpci.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36#ifndef _RTEMS_CONFDEFS_MPCI_H
37#define _RTEMS_CONFDEFS_MPCI_H
38
39#ifndef __CONFIGURATION_TEMPLATE_h
40#error "Do not include this file directly, use <rtems/confdefs.h> instead"
41#endif
42
43#ifdef CONFIGURE_INIT
44
45#ifdef RTEMS_MULTIPROCESSING
46
47#ifdef CONFIGURE_MP_APPLICATION
48
49#include <rtems/confdefs/threads.h>
50
51#ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
52 #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0
53#endif
54
55#ifndef CONFIGURE_MP_NODE_NUMBER
56 #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER
57#endif
58
59#ifndef CONFIGURE_MP_MAXIMUM_NODES
60 #define CONFIGURE_MP_MAXIMUM_NODES 2
61#endif
62
63#ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
64 #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32
65#endif
66
67#ifndef CONFIGURE_MP_MAXIMUM_PROXIES
68 #define CONFIGURE_MP_MAXIMUM_PROXIES 32
69#endif
70
71#ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
72 #include <mpci.h>
73
74 #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table
75#endif
76
77#if CONFIGURE_MP_NODE_NUMBER < 1
78 #error "CONFIGURE_MP_NODE_NUMBER must be greater than or equal to one"
79#endif
80
81#if CONFIGURE_MP_NODE_NUMBER > CONFIGURE_MP_MAXIMUM_NODES
82 #error "CONFIGURE_MP_NODE_NUMBER must be less than or equal to CONFIGURE_MP_MAXIMUM_NODES"
83#endif
84
85#ifdef __cplusplus
86extern "C" {
87#endif
88
89Objects_MP_Control _Objects_MP_Controls[
90 CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
91];
92
93struct Thread_Configured_proxy_control {
94 Thread_Proxy_control Control;
95 Thread_queue_Configured_heads Heads;
96};
97
98static Thread_Configured_proxy_control _Thread_MP_Configured_proxies[
99 CONFIGURE_MP_MAXIMUM_PROXIES
100];
101
102Thread_Configured_proxy_control * const _Thread_MP_Proxies =
103 &_Thread_MP_Configured_proxies[ 0 ];
104
105const MPCI_Configuration _MPCI_Configuration = {
106 CONFIGURE_MP_NODE_NUMBER,
107 CONFIGURE_MP_MAXIMUM_NODES,
108 CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS,
109 CONFIGURE_MP_MAXIMUM_PROXIES,
110 CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK,
111 CONFIGURE_MP_MPCI_TABLE_POINTER
112};
113
114char _MPCI_Receive_server_stack[
115 CONFIGURE_MINIMUM_TASK_STACK_SIZE
116 + CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
117 + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK
118 + CPU_ALL_TASKS_ARE_FP * CONTEXT_FP_SIZE
119] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT )
120 RTEMS_SECTION( ".rtemsstack.mpci" );
121
122#ifdef __cplusplus
123}
124#endif
125
126#endif /* CONFIGURE_MP_APPLICATION */
127
128#else /* RTEMS_MULTIPROCESSING */
129
130#ifdef CONFIGURE_MP_APPLICATION
131 #error "CONFIGURE_MP_APPLICATION must not be defined if multiprocessing is disabled"
132#endif
133
134#endif /* RTEMS_MULTIPROCESSING */
135
136#endif /* CONFIGURE_INIT */
137
138#endif /* _RTEMS_CONFDEFS_MPCI_H */
RTEMS_SECTION
#define RTEMS_SECTION(_section)
Instructs the compiler to place a specific variable or function in the specified section.
Definition: basedefs.h:154
RTEMS_ALIGNED
#define RTEMS_ALIGNED(_alignment)
Instructs the compiler to enforce the specified alignment.
Definition: basedefs.h:216
CONTEXT_FP_SIZE
#define CONTEXT_FP_SIZE
Size of floating point context area.
Definition: context.h:52
_MPCI_Receive_server_stack
char _MPCI_Receive_server_stack[]
The MPCI receive server stack.
_MPCI_Configuration
const MPCI_Configuration _MPCI_Configuration
The MPCI configuration.
Definition: mpcidefault.c:32
MPCI_Configuration
Definition: mpci.h:137
Thread_Proxy_control
Definition: thread.h:519
_Thread_queue_Heads
Thread queue heads.
Definition: threadq.h:360
threads.h
Evaluate Thread Configuration Options.