Changeset 8ca372e in rtems for cpukit/score/src/mpci.c


Ignore:
Timestamp:
Jan 26, 2016, 9:11:48 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
1ff8eca
Parents:
6bf44a5
git-author:
Sebastian Huber <sebastian.huber@…> (01/26/16 09:11:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/03/16 09:00:57)
Message:

Use linker set for MPCI initialization

Update #2408.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/mpci.c

    r6bf44a5 r8ca372e  
    2222#include <rtems/score/coresemimpl.h>
    2323#include <rtems/score/interr.h>
     24#include <rtems/score/objectmp.h>
    2425#include <rtems/score/stackimpl.h>
    2526#include <rtems/score/sysstate.h>
     
    2829#include <rtems/score/threadqimpl.h>
    2930#include <rtems/config.h>
     31#include <rtems/sysinit.h>
    3032
    3133RTEMS_STATIC_ASSERT(
     
    3436);
    3537
     38rtems_multiprocessing_table *_Configuration_MP_table;
     39
     40const rtems_multiprocessing_table
     41 _Initialization_Default_multiprocessing_table = {
     42  1,                        /* local node number */
     43  1,                        /* maximum number nodes in system */
     44  0,                        /* maximum number global objects */
     45  0,                        /* maximum number proxies */
     46  STACK_MINIMUM_SIZE,       /* MPCI receive server stack size */
     47  NULL                      /* pointer to MPCI address table */
     48};
     49
    3650/**
    3751 *  This is the core semaphore which the MPCI Receive Server blocks on.
     
    3953CORE_semaphore_Control _MPCI_Semaphore;
    4054
    41 void _MPCI_Handler_initialization(
    42   uint32_t   timeout_status
    43 )
     55static void _MPCI_Handler_early_initialization( void )
     56{
     57  /*
     58   *  Initialize the system state based on whether this is an MP system.
     59   *  In an MP configuration, internally we view single processor
     60   *  systems as a very restricted multiprocessor system.
     61   */
     62  _Configuration_MP_table = rtems_configuration_get_user_multiprocessing_table();
     63
     64  if ( _Configuration_MP_table == NULL ) {
     65    _Configuration_MP_table = RTEMS_DECONST(
     66      rtems_multiprocessing_table *,
     67      &_Initialization_Default_multiprocessing_table
     68    );
     69  } else {
     70    _System_state_Is_multiprocessing = true;
     71  }
     72
     73  _Objects_MP_Handler_early_initialization();
     74}
     75
     76static void _MPCI_Handler_initialization( void )
    4477{
    4578  CORE_semaphore_Attributes   attributes;
    4679  MPCI_Control               *users_mpci_table;
     80
     81  _Objects_MP_Handler_initialization();
    4782
    4883  users_mpci_table = _Configuration_MP_table->User_mpci_table;
     
    87122}
    88123
    89 void _MPCI_Create_server( void )
     124static void _MPCI_Create_server( void )
    90125{
    91126  Thread_Entry_information entry = {
     
    130165}
    131166
    132 void _MPCI_Initialization ( void )
     167static void _MPCI_Initialization( void )
    133168{
    134169  (*_MPCI_table->initialization)();
     
    430465}
    431466
     467static void _MPCI_Finalize( void )
     468{
     469  if ( _System_state_Is_multiprocessing ) {
     470    _MPCI_Initialization();
     471    _MPCI_Internal_packets_Send_process_packet( MPCI_PACKETS_SYSTEM_VERIFY );
     472  }
     473}
     474
     475RTEMS_SYSINIT_ITEM(
     476  _MPCI_Handler_early_initialization,
     477  RTEMS_SYSINIT_MP_EARLY,
     478  RTEMS_SYSINIT_ORDER_MIDDLE
     479);
     480
     481RTEMS_SYSINIT_ITEM(
     482  _MPCI_Handler_initialization,
     483  RTEMS_SYSINIT_MP,
     484  RTEMS_SYSINIT_ORDER_MIDDLE
     485);
     486
     487RTEMS_SYSINIT_ITEM(
     488  _MPCI_Create_server,
     489  RTEMS_SYSINIT_MP_SERVER,
     490  RTEMS_SYSINIT_ORDER_MIDDLE
     491);
     492
     493RTEMS_SYSINIT_ITEM(
     494  _MPCI_Finalize,
     495  RTEMS_SYSINIT_MP_FINALIZE,
     496  RTEMS_SYSINIT_ORDER_MIDDLE
     497);
     498
    432499/* end of file */
Note: See TracChangeset for help on using the changeset viewer.