Changeset aac75d3b in rtems for cpukit/sapi/src/exinit.c


Ignore:
Timestamp:
Dec 15, 2008, 7:21:01 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
bb9c80df
Parents:
197170b0
Message:

2008-12-15 Joel Sherrill <joel.sherrill@…>

  • itron/include/rtems/itron/itronapi.h, libmisc/capture/capture.c, libmisc/monitor/mon-config.c, libmisc/monitor/mon-driver.c, libmisc/monitor/mon-itask.c, libmisc/monitor/mon-mpci.c, posix/include/rtems/posix/config.h, posix/include/rtems/posix/posixapi.h, rtems/include/rtems/rtems/config.h, rtems/include/rtems/rtems/rtemsapi.h, rtems/src/taskinitusers.c, sapi/include/confdefs.h, sapi/include/rtems/config.h, sapi/include/rtems/init.h, sapi/src/exinit.c, sapi/src/itronapi.c, sapi/src/posixapi.c, sapi/src/rtemsapi.c, score/src/isr.c, score/src/thread.c, score/src/threadcreateidle.c, score/src/threadstackallocate.c, score/src/threadstackfree.c, score/src/wkspace.c: Eliminate pointers to API configuration tables in the main configuration table. Reference the main configuration table and the API configuration tables directly using the confdefs.h version rather than obtaining a pointer to it. This eliminated some variables, a potential fatal error, some unnecessary default configuration structures. Overall, about a 4.5% reduction in the code size for minimum and hello on the SPARC.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/src/exinit.c

    r197170b0 raac75d3b  
    5454#include <rtems/rtems/rtemsapi.h>
    5555#ifdef RTEMS_POSIX_API
    56 #include <rtems/posix/posixapi.h>
     56  #include <rtems/posix/posixapi.h>
    5757#endif
    5858#ifdef RTEMS_ITRON_API
    59 #include <rtems/itron/itronapi.h>
     59  #include <rtems/itron/itronapi.h>
    6060#endif
    6161
    6262Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ];
    6363
    64 void rtems_initialize_data_structures(
    65   rtems_configuration_table *configuration_table
    66 )
    67 {
    68   rtems_interrupt_level        bsp_level;
     64void rtems_initialize_data_structures(void)
     65{
     66  rtems_interrupt_level  bsp_level;
    6967
    7068  /*
     
    7674
    7775  /*
    78    *  Make sure the parameters were not NULL.
    79    */
    80   if ( configuration_table == NULL )
    81     _Internal_error_Occurred(
    82       INTERNAL_ERROR_CORE,
    83       TRUE,
    84       INTERNAL_ERROR_NO_CONFIGURATION_TABLE
    85     );
    86 
    87   /*
    88    *  Provide pointers just for later convenience.
    89    */
    90   _Configuration_Table    = configuration_table;
    91 
    92   /*
    9376   * Initialize any target architecture specific support as early as possible
    9477   */
    9578  _CPU_Initialize( _Thread_Dispatch );
    9679
    97 #if defined(RTEMS_MULTIPROCESSING)
    98   /*
    99    *  Initialize the system state based on whether this is an MP system.
    100    *  In an MP configuration, internally we view single processor
    101    *  systems as a very restricted multiprocessor system.
    102    */
    103   _Configuration_MP_table = configuration_table->User_multiprocessing_table;
    104 
    105   if ( _Configuration_MP_table == NULL ) {
    106     _Configuration_MP_table =
    107       (void *)&_Initialization_Default_multiprocessing_table;
     80  #if defined(RTEMS_MULTIPROCESSING)
     81    /*
     82     *  Initialize the system state based on whether this is an MP system.
     83     *  In an MP configuration, internally we view single processor
     84     *  systems as a very restricted multiprocessor system.
     85     */
     86    _Configuration_MP_table = Configuration.User_multiprocessing_table;
     87
     88    if ( _Configuration_MP_table == NULL ) {
     89      _Configuration_MP_table =
     90        (void *)&_Initialization_Default_multiprocessing_table;
     91      _System_state_Handler_initialization( FALSE );
     92    } else {
     93      _System_state_Handler_initialization( TRUE );
     94    }
     95  #else
    10896    _System_state_Handler_initialization( FALSE );
    109   } else {
    110     _System_state_Handler_initialization( TRUE );
    111   }
    112 #else
    113   _System_state_Handler_initialization( FALSE );
    114 #endif
    115 
    116   /*
    117    *  Do this as early as possible to insure no debugging output
     97  #endif
     98
     99  /*
     100   *  Do this as early as possible to ensure no debugging output
    118101   *  is even attempted to be printed.
    119102   */
     
    130113   */
    131114  _Workspace_Handler_initialization(
    132      (void *)configuration_table->work_space_start,
    133      configuration_table->work_space_size
     115    Configuration.work_space_start,
     116    Configuration.work_space_size
    134117  );
    135118
    136119  _User_extensions_Handler_initialization(
    137     configuration_table->number_of_initial_extensions,
    138     configuration_table->User_extension_table
     120    Configuration.number_of_initial_extensions,
     121    Configuration.User_extension_table
    139122  );
    140123
     
    142125
    143126  _Objects_Handler_initialization(
    144 #if defined(RTEMS_MULTIPROCESSING)
    145     _Configuration_MP_table->node,
    146     _Configuration_MP_table->maximum_nodes,
    147     _Configuration_MP_table->maximum_global_objects
    148 #endif
     127    #if defined(RTEMS_MULTIPROCESSING)
     128      _Configuration_MP_table->node,
     129      _Configuration_MP_table->maximum_nodes,
     130      _Configuration_MP_table->maximum_global_objects
     131    #endif
    149132  );
    150133
     
    161144  _Watchdog_Handler_initialization();
    162145
    163   _TOD_Handler_initialization( configuration_table->microseconds_per_tick );
     146  _TOD_Handler_initialization( Configuration.microseconds_per_tick );
    164147
    165148  _Thread_Handler_initialization(
    166     configuration_table->ticks_per_timeslice,
    167     configuration_table->maximum_extensions
    168 #if defined(RTEMS_MULTIPROCESSING)
    169     ,
    170     _Configuration_MP_table->maximum_proxies
    171 #endif
    172   );
    173 
    174 #if defined(RTEMS_MULTIPROCESSING)
    175   _MPCI_Handler_initialization(
    176     _Configuration_MP_table->User_mpci_table,
    177     RTEMS_TIMEOUT
    178   );
    179 #endif
     149    Configuration.ticks_per_timeslice,
     150    Configuration.maximum_extensions
     151    #if defined(RTEMS_MULTIPROCESSING)
     152      ,
     153      _Configuration_MP_table->maximum_proxies
     154    #endif
     155  );
     156
     157  #if defined(RTEMS_MULTIPROCESSING)
     158    _MPCI_Handler_initialization(
     159      _Configuration_MP_table->User_mpci_table,
     160      RTEMS_TIMEOUT
     161    );
     162  #endif
    180163
    181164/* MANAGERS */
    182165
    183   _RTEMS_API_Initialize( configuration_table );
    184 
    185   _Extension_Manager_initialization( configuration_table->maximum_extensions );
     166  _RTEMS_API_Initialize();
     167
     168  _Extension_Manager_initialization( Configuration.maximum_extensions );
    186169
    187170  _IO_Manager_initialization(
    188     configuration_table->Device_driver_table,
    189     configuration_table->number_of_device_drivers,
    190     configuration_table->maximum_drivers
    191   );
    192 
    193 #ifdef RTEMS_POSIX_API
    194   _POSIX_API_Initialize( configuration_table );
    195 #endif
    196 
    197 #ifdef RTEMS_ITRON_API
    198   _ITRON_API_Initialize( configuration_table );
    199 #endif
     171    Configuration.Device_driver_table,
     172    Configuration.number_of_device_drivers,
     173    Configuration.maximum_drivers
     174  );
     175
     176  #ifdef RTEMS_POSIX_API
     177    _POSIX_API_Initialize();
     178  #endif
     179
     180  #ifdef RTEMS_ITRON_API
     181    _ITRON_API_Initialize();
     182  #endif
    200183
    201184  _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING );
     
    219202{
    220203
    221 #if defined(RTEMS_MULTIPROCESSING)
    222   _MPCI_Create_server();
    223 #endif
     204  #if defined(RTEMS_MULTIPROCESSING)
     205    _MPCI_Create_server();
     206  #endif
    224207
    225208  /*
     
    241224  _IO_Initialize_all_drivers();
    242225
    243 #if defined(RTEMS_MULTIPROCESSING)
    244   if ( _System_state_Is_multiprocessing ) {
    245     _MPCI_Initialization();
    246     _MPCI_Internal_packets_Send_process_packet(
    247       MPCI_PACKETS_SYSTEM_VERIFY
    248     );
    249   }
    250 #endif
     226  #if defined(RTEMS_MULTIPROCESSING)
     227    if ( _System_state_Is_multiprocessing ) {
     228      _MPCI_Initialization();
     229      _MPCI_Internal_packets_Send_process_packet(
     230        MPCI_PACKETS_SYSTEM_VERIFY
     231      );
     232    }
     233  #endif
    251234
    252235  /*
Note: See TracChangeset for help on using the changeset viewer.