Changeset 1d9f509e in rtems


Ignore:
Timestamp:
Dec 12, 2019, 7:43:06 AM (12 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
3fba9de2
Parents:
24f8915
git-author:
Sebastian Huber <sebastian.huber@…> (12/12/19 07:43:06)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/13/19 07:35:21)
Message:

config: Statically allocate MP thread proxies

Update #3735.

Location:
cpukit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/confdefs.h

    r24f8915 r1d9f509e  
    18321832      #define CONFIGURE_MP_MAXIMUM_PROXIES            32
    18331833    #endif
    1834     #define _CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
    1835       _Configure_From_workspace((_proxies) \
    1836         * (sizeof(Thread_Proxy_control) \
    1837           + sizeof(Thread_queue_Configured_heads)))
    18381834
    18391835    #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
     
    18501846        #error "CONFIGURE_MP_NODE_NUMBER must be less than or equal to CONFIGURE_MP_MAXIMUM_NODES"
    18511847      #endif
     1848
     1849      struct Thread_Configured_proxy_control {
     1850        Thread_Proxy_control Control;
     1851        Thread_queue_Configured_heads Heads;
     1852      };
     1853
     1854      static Thread_Configured_proxy_control _Thread_MP_Configured_proxies[
     1855        CONFIGURE_MP_MAXIMUM_PROXIES
     1856      ];
     1857
     1858      Thread_Configured_proxy_control * const _Thread_MP_Proxies =
     1859        &_Thread_MP_Configured_proxies[ 0 ];
    18521860
    18531861      const MPCI_Configuration _MPCI_Configuration = {
     
    23922400#ifdef CONFIGURE_MP_APPLICATION
    23932401  #define _CONFIGURE_MEMORY_FOR_MP \
    2394     (_CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
    2395      _CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS))
     2402     _CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS)
    23962403#else
    23972404  #define _CONFIGURE_MEMORY_FOR_MP  0
  • cpukit/include/rtems/score/thread.h

    r24f8915 r1d9f509e  
    10661066}
    10671067
     1068#if defined(RTEMS_MULTIPROCESSING)
     1069/**
     1070 * @brief The configured thread control block.
     1071 *
     1072 * This type is defined in <rtems/confdefs.h> and depends on the application
     1073 * configuration.
     1074 */
     1075typedef struct Thread_Configured_proxy_control Thread_Configured_proxy_control;
     1076
     1077/**
     1078 * @brief The configured proxies.
     1079 *
     1080 * Provided by the application via <rtems/confdefs.h>.
     1081 */
     1082extern Thread_Configured_proxy_control * const _Thread_MP_Proxies;
     1083#endif
     1084
    10681085/** @} */
    10691086
  • cpukit/score/src/mpcidefault.c

    r24f8915 r1d9f509e  
    2121#include <rtems/score/mpci.h>
    2222#include <rtems/score/stack.h>
     23#include <rtems/score/thread.h>
     24
     25Thread_Configured_proxy_control * const _Thread_MP_Proxies;
    2326
    2427const MPCI_Configuration _MPCI_Configuration = {
  • cpukit/score/src/threadmp.c

    r24f8915 r1d9f509e  
    2222#include <rtems/score/isrlock.h>
    2323#include <rtems/score/schedulerimpl.h>
    24 #include <rtems/score/wkspace.h>
    2524
    2625#include <string.h>
     
    4746{
    4847  size_t    proxy_size;
    49   size_t    alloc_size;
    5048  char     *proxies;
    5149  uint32_t  i;
     
    5654
    5755  proxy_size = sizeof( Thread_Proxy_control ) + _Thread_queue_Heads_size;
    58   alloc_size = maximum_proxies * proxy_size;
    59   proxies = _Workspace_Allocate_or_fatal_error( alloc_size );
    60   memset( proxies, 0, alloc_size );
     56  proxies = (char *) _Thread_MP_Proxies;
    6157
    6258  _Chain_Initialize(
Note: See TracChangeset for help on using the changeset viewer.