config: Statically allocate MP thread proxies

Update #3735.
This commit is contained in:
Sebastian Huber
2019-12-13 08:35:21 +01:00
parent 24f8915a07
commit 1d9f509e68
4 changed files with 34 additions and 11 deletions
+13 -6
View File
@@ -1831,10 +1831,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
#ifndef CONFIGURE_MP_MAXIMUM_PROXIES
#define CONFIGURE_MP_MAXIMUM_PROXIES 32
#endif
#define _CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
_Configure_From_workspace((_proxies) \
* (sizeof(Thread_Proxy_control) \
+ sizeof(Thread_queue_Configured_heads)))
#ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
#include <mpci.h>
@@ -1850,6 +1846,18 @@ extern rtems_initialization_tasks_table Initialization_tasks[];
#error "CONFIGURE_MP_NODE_NUMBER must be less than or equal to CONFIGURE_MP_MAXIMUM_NODES"
#endif
struct Thread_Configured_proxy_control {
Thread_Proxy_control Control;
Thread_queue_Configured_heads Heads;
};
static Thread_Configured_proxy_control _Thread_MP_Configured_proxies[
CONFIGURE_MP_MAXIMUM_PROXIES
];
Thread_Configured_proxy_control * const _Thread_MP_Proxies =
&_Thread_MP_Configured_proxies[ 0 ];
const MPCI_Configuration _MPCI_Configuration = {
CONFIGURE_MP_NODE_NUMBER, /* local node number */
CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes */
@@ -2391,8 +2399,7 @@ struct _reent *__getreent(void)
*/
#ifdef CONFIGURE_MP_APPLICATION
#define _CONFIGURE_MEMORY_FOR_MP \
(_CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
_CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS))
_CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS)
#else
#define _CONFIGURE_MEMORY_FOR_MP 0
#endif
+17
View File
@@ -1065,6 +1065,23 @@ Thread_Information name##_Information = { \
} \
}
#if defined(RTEMS_MULTIPROCESSING)
/**
* @brief The configured thread control block.
*
* This type is defined in <rtems/confdefs.h> and depends on the application
* configuration.
*/
typedef struct Thread_Configured_proxy_control Thread_Configured_proxy_control;
/**
* @brief The configured proxies.
*
* Provided by the application via <rtems/confdefs.h>.
*/
extern Thread_Configured_proxy_control * const _Thread_MP_Proxies;
#endif
/** @} */
#ifdef __cplusplus
+3
View File
@@ -20,6 +20,9 @@
#include <rtems/score/mpci.h>
#include <rtems/score/stack.h>
#include <rtems/score/thread.h>
Thread_Configured_proxy_control * const _Thread_MP_Proxies;
const MPCI_Configuration _MPCI_Configuration = {
1, /* local node number */
+1 -5
View File
@@ -21,7 +21,6 @@
#include <rtems/score/threadimpl.h>
#include <rtems/score/isrlock.h>
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/wkspace.h>
#include <string.h>
@@ -46,7 +45,6 @@ void _Thread_MP_Handler_initialization (
)
{
size_t proxy_size;
size_t alloc_size;
char *proxies;
uint32_t i;
@@ -55,9 +53,7 @@ void _Thread_MP_Handler_initialization (
}
proxy_size = sizeof( Thread_Proxy_control ) + _Thread_queue_Heads_size;
alloc_size = maximum_proxies * proxy_size;
proxies = _Workspace_Allocate_or_fatal_error( alloc_size );
memset( proxies, 0, alloc_size );
proxies = (char *) _Thread_MP_Proxies;
_Chain_Initialize(
&_Thread_MP_Inactive_proxies,