Changeset 24f8915 in rtems


Ignore:
Timestamp:
Dec 12, 2019, 6:11:54 AM (12 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
1d9f509e
Parents:
a00dff42
git-author:
Sebastian Huber <sebastian.huber@…> (12/12/19 06:11:54)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/13/19 07:35:17)
Message:

config: Add _MPCI_Configuration

Replace the user MPCI configuration table with a system provided
_MPCI_Configuration.

Update #3735.

Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • bsps/include/shm_driver.h

    ra00dff42 r24f8915  
    434434typedef struct shm_config_info shm_config_table;
    435435
    436 #define SHM_MAXIMUM_NODES Multiprocessing_configuration.maximum_nodes
     436#define SHM_MAXIMUM_NODES _MPCI_Configuration.maximum_nodes
    437437
    438438/* global variables */
  • cpukit/Makefile.am

    ra00dff42 r24f8915  
    10651065librtemscpu_a_SOURCES += rtems/src/taskmp.c
    10661066librtemscpu_a_SOURCES += score/src/mpci.c
     1067librtemscpu_a_SOURCES += score/src/mpcidefault.c
    10671068librtemscpu_a_SOURCES += score/src/objectmp.c
    10681069librtemscpu_a_SOURCES += score/src/threadmp.c
  • cpukit/include/rtems/confdefs.h

    ra00dff42 r24f8915  
    18431843
    18441844    #ifdef CONFIGURE_INIT
    1845       rtems_multiprocessing_table Multiprocessing_configuration = {
     1845      #if CONFIGURE_MP_NODE_NUMBER < 1
     1846        #error "CONFIGURE_MP_NODE_NUMBER must be greater than or equal to one"
     1847      #endif
     1848
     1849      #if CONFIGURE_MP_NODE_NUMBER > CONFIGURE_MP_MAXIMUM_NODES
     1850        #error "CONFIGURE_MP_NODE_NUMBER must be less than or equal to CONFIGURE_MP_MAXIMUM_NODES"
     1851      #endif
     1852
     1853      const MPCI_Configuration _MPCI_Configuration = {
    18461854        CONFIGURE_MP_NODE_NUMBER,               /* local node number */
    18471855        CONFIGURE_MP_MAXIMUM_NODES,             /* maximum # nodes */
     
    18531861    #endif
    18541862
    1855     #define CONFIGURE_MULTIPROCESSING_TABLE    &Multiprocessing_configuration
    1856 
    18571863    #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 1
    18581864  #else
    1859     #define CONFIGURE_MULTIPROCESSING_TABLE NULL
    18601865    #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0
    18611866  #endif /* CONFIGURE_MP_APPLICATION */
     
    28782883        false,
    28792884      #endif
    2880     #endif
    2881     #if defined(RTEMS_MULTIPROCESSING)
    2882       CONFIGURE_MULTIPROCESSING_TABLE,        /* pointer to MP config table */
    28832885    #endif
    28842886    #ifdef RTEMS_SMP
  • cpukit/include/rtems/config.h

    ra00dff42 r24f8915  
    3636#include <rtems/extension.h>
    3737#if defined(RTEMS_MULTIPROCESSING)
    38 #include <rtems/score/mpci.h>
     38#include <rtems/rtems/types.h>
    3939#endif
    4040
     
    5353#define rtems_resource_maximum_per_allocation(resource) \
    5454  _Objects_Maximum_per_allocation(resource)
    55 
    56 #if defined(RTEMS_MULTIPROCESSING)
    57 /*
    58  *  The following records define the Multiprocessor Configuration
    59  *  Table.  This table defines the multiprocessor system
    60  *  characteristics which must be known by RTEMS in a multiprocessor
    61  *  system.
    62  */
    63 typedef struct {
    64   /** This is the local node number. */
    65   uint32_t            node;
    66   /** This is the maximum number of nodes in system. */
    67   uint32_t            maximum_nodes;
    68   /** This is the maximum number of global objects. */
    69   uint32_t            maximum_global_objects;
    70   /** This is the maximum number of proxies. */
    71   uint32_t            maximum_proxies;
    72 
    73   /**
    74    * The MPCI Receive server is assumed to have a stack of at least
    75    * minimum stack size.  This field specifies the amount of extra
    76    * stack this task will be given in bytes.
    77    */
    78   uint32_t            extra_mpci_receive_server_stack;
    79 
    80   /** This is a pointer to User/BSP provided MPCI Table. */
    81   rtems_mpci_table   *User_mpci_table;
    82 } rtems_multiprocessing_table;
    83 #endif
    8455
    8556/**
     
    207178  #endif
    208179
    209   #if defined(RTEMS_MULTIPROCESSING)
    210     rtems_multiprocessing_table   *User_multiprocessing_table;
    211   #endif
    212180  #ifdef RTEMS_SMP
    213181    uint32_t                     maximum_processors;
     
    219187 */
    220188extern const rtems_configuration_table Configuration;
    221 
    222 #if defined(RTEMS_MULTIPROCESSING)
    223   /**
    224    *  This points to the multiprocessing configuration table.
    225    */
    226   extern rtems_multiprocessing_table *_Configuration_MP_table;
    227 #endif
    228 
    229 #if defined(RTEMS_MULTIPROCESSING)
    230   /**
    231    * @brief RTEMS multiprocessing configuration table.
    232    *
    233    * This is the RTEMS Multiprocessing Configuration Table expected to
    234    * be generated by confdefs.h.
    235    */
    236   extern rtems_multiprocessing_table Multiprocessing_configuration;
    237 
    238   /*
    239    *  This is the default Multiprocessing Configuration Table.
    240    *  It is used in single processor configurations.
    241    */
    242   extern const rtems_multiprocessing_table
    243     _Initialization_Default_multiprocessing_table;
    244 #endif
    245 
    246189
    247190/*
     
    309252#if defined(RTEMS_MULTIPROCESSING)
    310253  #define rtems_configuration_get_user_multiprocessing_table() \
    311         (Configuration.User_multiprocessing_table)
     254    (&_MPCI_Configuration)
    312255#else
    313256  #define rtems_configuration_get_user_multiprocessing_table() \
    314         NULL
     257    NULL
    315258#endif
    316259
  • cpukit/include/rtems/rtems/types.h

    ra00dff42 r24f8915  
    222222typedef MPCI_Control               rtems_mpci_table;
    223223
     224/**
     225 * @brief Structure which is used to configure an MPCI handler.
     226 */
     227typedef MPCI_Configuration         rtems_multiprocessing_table;
     228
    224229#endif
    225230
  • cpukit/include/rtems/score/mpci.h

    ra00dff42 r24f8915  
    129129} MPCI_Control;
    130130
     131/*
     132 *  The following records define the Multiprocessor Configuration
     133 *  Table.  This table defines the multiprocessor system
     134 *  characteristics which must be known by RTEMS in a multiprocessor
     135 *  system.
     136 */
     137typedef struct {
     138  /** This is the local node number. */
     139  uint32_t            node;
     140  /** This is the maximum number of nodes in system. */
     141  uint32_t            maximum_nodes;
     142  /** This is the maximum number of global objects. */
     143  uint32_t            maximum_global_objects;
     144  /** This is the maximum number of proxies. */
     145  uint32_t            maximum_proxies;
     146
     147  /**
     148   * The MPCI Receive server is assumed to have a stack of at least
     149   * minimum stack size.  This field specifies the amount of extra
     150   * stack this task will be given in bytes.
     151   */
     152  uint32_t            extra_mpci_receive_server_stack;
     153
     154  /** This is a pointer to User/BSP provided MPCI Table. */
     155  MPCI_Control       *User_mpci_table;
     156} MPCI_Configuration;
     157
     158/**
     159 * @brief The MPCI configuration.
     160 *
     161 * Provided by the application via <rtems/confdefs.h>.
     162 */
     163extern const MPCI_Configuration _MPCI_Configuration;
     164
    131165/** @} */
    132166
  • cpukit/libmisc/monitor/mon-monitor.c

    ra00dff42 r24f8915  
    361361
    362362  if ((new_node >= 1) &&
    363     _Configuration_MP_table &&
    364     (new_node <= _Configuration_MP_table->maximum_nodes))
     363    (new_node <= _MPCI_Configuration.maximum_nodes))
    365364        rtems_monitor_default_node = new_node;
    366365}
  • cpukit/libmisc/monitor/mon-mpci.c

    ra00dff42 r24f8915  
    2929)
    3030{
    31     const rtems_configuration_table *c = &Configuration;
    32     rtems_multiprocessing_table *m;
    33     rtems_mpci_table *mt;
     31    const rtems_multiprocessing_table *m;
     32    const rtems_mpci_table *mt;
    3433
    35     m = c->User_multiprocessing_table;
    36     if (m == 0)
    37         return;
     34    m = rtems_configuration_get_user_multiprocessing_table();
    3835    mt = m->User_mpci_table;
    3936
     
    7168)
    7269{
    73     const rtems_configuration_table *c = &Configuration;
    7470    int n = rtems_object_id_get_index(*next_id);
    7571
     
    7773        goto failed;
    7874
    79     if ( ! c->User_multiprocessing_table)
    80         goto failed;
    81 
    8275    _Objects_Allocator_lock();
    8376
    8477    *next_id += 1;
    85     return (void *) c;
     78    return &Configuration;
    8679
    8780failed:
  • cpukit/libmisc/monitor/mon-server.c

    ra00dff42 r24f8915  
    222222
    223223    if (_System_state_Is_multiprocessing    &&
    224         (_Configuration_MP_table->maximum_nodes > 1))
    225     {
    226         uint32_t   maximum_nodes = _Configuration_MP_table->maximum_nodes;
     224        (_MPCI_Configuration.maximum_nodes > 1))
     225    {
     226        uint32_t   maximum_nodes = _MPCI_Configuration.maximum_nodes;
    227227
    228228        /*
  • cpukit/score/src/mpci.c

    ra00dff42 r24f8915  
    2828#include <rtems/score/threadimpl.h>
    2929#include <rtems/score/threadqimpl.h>
    30 #include <rtems/config.h>
    3130#include <rtems/sysinit.h>
    3231
     
    4039bool _System_state_Is_multiprocessing;
    4140
    42 rtems_multiprocessing_table *_Configuration_MP_table;
    43 
    44 const rtems_multiprocessing_table
    45  _Initialization_Default_multiprocessing_table = {
    46   1,                        /* local node number */
    47   1,                        /* maximum number nodes in system */
    48   0,                        /* maximum number global objects */
    49   0,                        /* maximum number proxies */
    50   STACK_MINIMUM_SIZE,       /* MPCI receive server stack size */
    51   NULL                      /* pointer to MPCI address table */
    52 };
    53 
    5441/**
    5542 *  This is the core semaphore which the MPCI Receive Server blocks on.
     
    7360   *  systems as a very restricted multiprocessor system.
    7461   */
    75   _Configuration_MP_table = rtems_configuration_get_user_multiprocessing_table();
    76 
    77   if ( _Configuration_MP_table == NULL ) {
    78     _Configuration_MP_table = RTEMS_DECONST(
    79       rtems_multiprocessing_table *,
    80       &_Initialization_Default_multiprocessing_table
    81     );
    82   } else {
     62  if ( _MPCI_Configuration.maximum_nodes > 1 ) {
    8363    _System_state_Is_multiprocessing = true;
    8464  }
     
    9373  _Objects_MP_Handler_initialization();
    9474
    95   users_mpci_table = _Configuration_MP_table->User_mpci_table;
     75  users_mpci_table = _MPCI_Configuration.User_mpci_table;
    9676
    9777  if ( _System_state_Is_multiprocessing && !users_mpci_table )
     
    153133    _Stack_Minimum() +
    154134      CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK +
    155       _Configuration_MP_table->extra_mpci_receive_server_stack,
     135      _MPCI_Configuration.extra_mpci_receive_server_stack,
    156136    CPU_ALL_TASKS_ARE_FP,
    157137    PRIORITY_PSEUDO_ISR,
  • cpukit/score/src/objectmp.c

    ra00dff42 r24f8915  
    162162  uint32_t   maximum_nodes;
    163163
    164   node                   = _Configuration_MP_table->node;
    165   maximum_nodes          = _Configuration_MP_table->maximum_nodes;
     164  node                   = _MPCI_Configuration.node;
     165  maximum_nodes          = _MPCI_Configuration.maximum_nodes;
    166166
    167167  if ( node < 1 || node > maximum_nodes )
     
    176176  uint32_t maximum_global_objects;
    177177
    178   maximum_global_objects = _Configuration_MP_table->maximum_global_objects;
     178  maximum_global_objects = _MPCI_Configuration.maximum_global_objects;
    179179
    180180  _Objects_MP_Maximum_global_objects = maximum_global_objects;
  • cpukit/score/src/thread.c

    ra00dff42 r24f8915  
    6363  #if defined(RTEMS_MULTIPROCESSING)
    6464    uint32_t maximum_proxies =
    65       _Configuration_MP_table->maximum_proxies;
     65      _MPCI_Configuration.maximum_proxies;
    6666  #endif
    6767
  • testsuites/sptests/spsize/size.c

    ra00dff42 r24f8915  
    251251/*clock.h*/     0                                         +
    252252
    253 /*config.h*/
    254         #if defined(RTEMS_MULTIPROCESSING)
    255                 (sizeof _Configuration_MP_table)          +
    256         #endif
     253/*config.h*/    0                                         +
    257254
    258255/*context.h*/   (sizeof _Thread_Dispatch_necessary)        +
     
    434431initialized +=
    435432/*copyrt.h*/    (strlen(_Copyright_Notice)+1)             +
    436 
    437 #if defined(RTEMS_MULTIPROCESSING)
    438                 (sizeof _Initialization_Default_multiprocessing_table)  +
    439 #endif
    440433                (strlen(_RTEMS_version)+1);
    441434
Note: See TracChangeset for help on using the changeset viewer.