diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-12 07:11:54 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-13 08:35:17 +0100 |
commit | 24f8915a079446918abd4f7b2a8e1b8385930f85 (patch) | |
tree | 708417a866d436b619e471d834b56f95109eb66f /cpukit/score | |
parent | rtems: Add and use rtems_object_get_local_node() (diff) | |
download | rtems-24f8915a079446918abd4f7b2a8e1b8385930f85.tar.bz2 |
config: Add _MPCI_Configuration
Replace the user MPCI configuration table with a system provided
_MPCI_Configuration.
Update #3735.
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/src/mpci.c | 26 | ||||
-rw-r--r-- | cpukit/score/src/mpcidefault.c | 31 | ||||
-rw-r--r-- | cpukit/score/src/objectmp.c | 6 | ||||
-rw-r--r-- | cpukit/score/src/thread.c | 2 |
4 files changed, 38 insertions, 27 deletions
diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c index f488325fc5..513d096480 100644 --- a/cpukit/score/src/mpci.c +++ b/cpukit/score/src/mpci.c @@ -27,7 +27,6 @@ #include <rtems/score/schedulerimpl.h> #include <rtems/score/threadimpl.h> #include <rtems/score/threadqimpl.h> -#include <rtems/config.h> #include <rtems/sysinit.h> RTEMS_STATIC_ASSERT( @@ -39,18 +38,6 @@ RTEMS_STATIC_ASSERT( bool _System_state_Is_multiprocessing; -rtems_multiprocessing_table *_Configuration_MP_table; - -const rtems_multiprocessing_table - _Initialization_Default_multiprocessing_table = { - 1, /* local node number */ - 1, /* maximum number nodes in system */ - 0, /* maximum number global objects */ - 0, /* maximum number proxies */ - STACK_MINIMUM_SIZE, /* MPCI receive server stack size */ - NULL /* pointer to MPCI address table */ -}; - /** * This is the core semaphore which the MPCI Receive Server blocks on. */ @@ -72,14 +59,7 @@ static void _MPCI_Handler_early_initialization( void ) * In an MP configuration, internally we view single processor * systems as a very restricted multiprocessor system. */ - _Configuration_MP_table = rtems_configuration_get_user_multiprocessing_table(); - - if ( _Configuration_MP_table == NULL ) { - _Configuration_MP_table = RTEMS_DECONST( - rtems_multiprocessing_table *, - &_Initialization_Default_multiprocessing_table - ); - } else { + if ( _MPCI_Configuration.maximum_nodes > 1 ) { _System_state_Is_multiprocessing = true; } @@ -92,7 +72,7 @@ static void _MPCI_Handler_initialization( void ) _Objects_MP_Handler_initialization(); - users_mpci_table = _Configuration_MP_table->User_mpci_table; + users_mpci_table = _MPCI_Configuration.User_mpci_table; if ( _System_state_Is_multiprocessing && !users_mpci_table ) _Internal_error( INTERNAL_ERROR_NO_MPCI ); @@ -152,7 +132,7 @@ static void _MPCI_Create_server( void ) NULL, /* allocate the stack */ _Stack_Minimum() + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + - _Configuration_MP_table->extra_mpci_receive_server_stack, + _MPCI_Configuration.extra_mpci_receive_server_stack, CPU_ALL_TASKS_ARE_FP, PRIORITY_PSEUDO_ISR, false, /* no preempt */ diff --git a/cpukit/score/src/mpcidefault.c b/cpukit/score/src/mpcidefault.c new file mode 100644 index 0000000000..60f1ef31a7 --- /dev/null +++ b/cpukit/score/src/mpcidefault.c @@ -0,0 +1,31 @@ +/** + * @file + * + * @brief Multiprocessing Communications Interface (MPCI) Default Configuration + * @ingroup RTEMSScoreMPCI + */ + +/* + * COPYRIGHT (c) 1989-2014. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include <rtems/score/mpci.h> +#include <rtems/score/stack.h> + +const MPCI_Configuration _MPCI_Configuration = { + 1, /* local node number */ + 1, /* maximum number nodes in system */ + 0, /* maximum number global objects */ + 0, /* maximum number proxies */ + STACK_MINIMUM_SIZE, /* MPCI receive server stack size */ + NULL /* pointer to MPCI address table */ +}; diff --git a/cpukit/score/src/objectmp.c b/cpukit/score/src/objectmp.c index 74ed22033a..1910b8ccba 100644 --- a/cpukit/score/src/objectmp.c +++ b/cpukit/score/src/objectmp.c @@ -161,8 +161,8 @@ void _Objects_MP_Handler_early_initialization(void) uint32_t node; uint32_t maximum_nodes; - node = _Configuration_MP_table->node; - maximum_nodes = _Configuration_MP_table->maximum_nodes; + node = _MPCI_Configuration.node; + maximum_nodes = _MPCI_Configuration.maximum_nodes; if ( node < 1 || node > maximum_nodes ) _Internal_error( INTERNAL_ERROR_INVALID_NODE ); @@ -175,7 +175,7 @@ void _Objects_MP_Handler_initialization( void ) { uint32_t maximum_global_objects; - maximum_global_objects = _Configuration_MP_table->maximum_global_objects; + maximum_global_objects = _MPCI_Configuration.maximum_global_objects; _Objects_MP_Maximum_global_objects = maximum_global_objects; diff --git a/cpukit/score/src/thread.c b/cpukit/score/src/thread.c index 812d9296af..32a5132eee 100644 --- a/cpukit/score/src/thread.c +++ b/cpukit/score/src/thread.c @@ -62,7 +62,7 @@ void _Thread_Handler_initialization(void) rtems_configuration_get_stack_allocate_init_hook(); #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = - _Configuration_MP_table->maximum_proxies; + _MPCI_Configuration.maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || |