Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:12

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RTEMSImplApplConfig
0007  *
0008  * @brief This header file evaluates configuration options related to the MPCI
0009  *   configuration.
0010  */
0011 
0012 /*
0013  * Copyright (C) 2020 embedded brains GmbH & Co. KG
0014  *
0015  * Redistribution and use in source and binary forms, with or without
0016  * modification, are permitted provided that the following conditions
0017  * are met:
0018  * 1. Redistributions of source code must retain the above copyright
0019  *    notice, this list of conditions and the following disclaimer.
0020  * 2. Redistributions in binary form must reproduce the above copyright
0021  *    notice, this list of conditions and the following disclaimer in the
0022  *    documentation and/or other materials provided with the distribution.
0023  *
0024  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0025  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0026  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0027  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0028  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0029  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0030  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0031  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0032  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0033  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0034  * POSSIBILITY OF SUCH DAMAGE.
0035  */
0036 
0037 #ifndef _RTEMS_CONFDEFS_MPCI_H
0038 #define _RTEMS_CONFDEFS_MPCI_H
0039 
0040 #ifndef __CONFIGURATION_TEMPLATE_h
0041 #error "Do not include this file directly, use <rtems/confdefs.h> instead"
0042 #endif
0043 
0044 #ifdef CONFIGURE_INIT
0045 
0046 #ifdef RTEMS_MULTIPROCESSING
0047 
0048 #ifdef CONFIGURE_MP_APPLICATION
0049 
0050 #include <rtems/confdefs/threads.h>
0051 
0052 #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
0053   #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0
0054 #endif
0055 
0056 #ifndef CONFIGURE_MP_NODE_NUMBER
0057   #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER
0058 #endif
0059 
0060 #ifndef CONFIGURE_MP_MAXIMUM_NODES
0061   #define CONFIGURE_MP_MAXIMUM_NODES 2
0062 #endif
0063 
0064 #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
0065   #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32
0066 #endif
0067 
0068 #ifndef CONFIGURE_MP_MAXIMUM_PROXIES
0069   #define CONFIGURE_MP_MAXIMUM_PROXIES 32
0070 #endif
0071 
0072 #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
0073   #include <mpci.h>
0074 
0075   #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table
0076 #endif
0077 
0078 #if CONFIGURE_MP_NODE_NUMBER < 1
0079   #error "CONFIGURE_MP_NODE_NUMBER must be greater than or equal to one"
0080 #endif
0081 
0082 #if CONFIGURE_MP_NODE_NUMBER > CONFIGURE_MP_MAXIMUM_NODES
0083   #error "CONFIGURE_MP_NODE_NUMBER must be less than or equal to CONFIGURE_MP_MAXIMUM_NODES"
0084 #endif
0085 
0086 #ifdef __cplusplus
0087 extern "C" {
0088 #endif
0089 
0090 Objects_MP_Control _Objects_MP_Controls[
0091   CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
0092 ];
0093 
0094 struct Thread_Configured_proxy_control {
0095   Thread_Proxy_control Control;
0096   Thread_queue_Configured_heads Heads;
0097 };
0098 
0099 static Thread_Configured_proxy_control _Thread_MP_Configured_proxies[
0100   CONFIGURE_MP_MAXIMUM_PROXIES
0101 ];
0102 
0103 Thread_Configured_proxy_control * const _Thread_MP_Proxies =
0104   &_Thread_MP_Configured_proxies[ 0 ];
0105 
0106 const MPCI_Configuration _MPCI_Configuration = {
0107   CONFIGURE_MP_NODE_NUMBER,
0108   CONFIGURE_MP_MAXIMUM_NODES,
0109   CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS,
0110   CONFIGURE_MP_MAXIMUM_PROXIES,
0111   CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK,
0112   CONFIGURE_MP_MPCI_TABLE_POINTER
0113 };
0114 
0115 char _MPCI_Receive_server_stack[
0116   CONFIGURE_MINIMUM_TASK_STACK_SIZE
0117     + CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
0118     + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK
0119     + CPU_ALL_TASKS_ARE_FP * CONTEXT_FP_SIZE
0120 ] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT )
0121 RTEMS_SECTION( ".rtemsstack.mpci" );
0122 
0123 #ifdef __cplusplus
0124 }
0125 #endif
0126 
0127 #endif /* CONFIGURE_MP_APPLICATION */
0128 
0129 #else /* RTEMS_MULTIPROCESSING */
0130 
0131 #ifdef CONFIGURE_MP_APPLICATION
0132   #error "CONFIGURE_MP_APPLICATION must not be defined if multiprocessing is disabled"
0133 #endif
0134 
0135 #endif /* RTEMS_MULTIPROCESSING */
0136 
0137 #endif /* CONFIGURE_INIT */
0138 
0139 #endif /* _RTEMS_CONFDEFS_MPCI_H */