Changeset a853c851 in rtems


Ignore:
Timestamp:
Dec 10, 2015, 2:44:02 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
92bb345
Parents:
36b86d7
git-author:
Sebastian Huber <sebastian.huber@…> (12/10/15 14:44:02)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/03/16 09:00:51)
Message:

Optional Initial Extensions initialization

Update #2408.

Files:
7 edited

Legend:

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

    r36b86d7 ra853c851  
    2727 */
    2828#include <rtems.h>
     29#include <rtems/sysinit.h>
    2930#include <rtems/score/apimutex.h>
    3031#include <rtems/score/percpu.h>
     32#include <rtems/score/userextimpl.h>
    3133#include <rtems/score/wkspace.h>
    3234
     
    23952397  #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \
    23962398    RTEMS_ARRAY_SIZE(Configuration_Initial_Extensions)
     2399
     2400  RTEMS_SYSINIT_ITEM(
     2401    _User_extensions_Handler_initialization,
     2402    RTEMS_SYSINIT_INITIAL_EXTENSIONS,
     2403    RTEMS_SYSINIT_ORDER_MIDDLE
     2404  );
    23972405#else
    23982406  #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL
  • cpukit/sapi/src/exinit.c

    r36b86d7 ra853c851  
    4848#include <rtems/score/threadimpl.h>
    4949#include <rtems/score/todimpl.h>
    50 #include <rtems/score/userextimpl.h>
    5150#include <rtems/score/watchdogimpl.h>
    5251#include <rtems/score/wkspace.h>
     
    114113  _Thread_Dispatch_initialization();
    115114
    116   _User_extensions_Handler_initialization();
    117115  _ISR_Handler_initialization();
    118116
  • cpukit/score/include/rtems/sysinit.h

    r36b86d7 ra853c851  
    2929#define RTEMS_SYSINIT_BSP_WORK_AREAS             000100
    3030#define RTEMS_SYSINIT_BSP_START                  000200
    31 #define RTEMS_SYSINIT_DATA_STRUCTURES            000300
     31#define RTEMS_SYSINIT_INITIAL_EXTENSIONS         000300
     32#define RTEMS_SYSINIT_DATA_STRUCTURES            000301
    3233#define RTEMS_SYSINIT_IDLE_THREADS               000380
    3334#define RTEMS_SYSINIT_BSP_LIBC                   000400
  • cpukit/score/src/threaddispatch.c

    r36b86d7 ra853c851  
    3030#include <rtems/score/wkspace.h>
    3131#include <rtems/config.h>
     32
     33CHAIN_DEFINE_EMPTY( _User_extensions_Switches_list );
    3234
    3335static Thread_Action *_Thread_Get_post_switch_action(
  • cpukit/score/src/userext.c

    r36b86d7 ra853c851  
    2323#include <rtems/score/userextimpl.h>
    2424#include <rtems/score/wkspace.h>
    25 
    26 CHAIN_DEFINE_EMPTY( _User_extensions_Switches_list );
    2725
    2826typedef struct {
     
    5149void _User_extensions_Handler_initialization(void)
    5250{
    53   uint32_t number_of_initial_extensions =
    54     rtems_configuration_get_number_of_initial_extensions();
     51  User_extensions_Switch_control *initial_extension_switch_controls =
     52    _Workspace_Allocate_or_fatal_error(
     53      rtems_configuration_get_number_of_initial_extensions()
     54        * sizeof( *initial_extension_switch_controls )
     55    );
     56  User_extensions_Switch_context ctx = { initial_extension_switch_controls };
    5557
    56   if ( number_of_initial_extensions > 0 ) {
    57     User_extensions_Switch_control *initial_extension_switch_controls =
    58       _Workspace_Allocate_or_fatal_error(
    59         number_of_initial_extensions
    60           * sizeof( *initial_extension_switch_controls )
    61       );
    62     User_extensions_Switch_context ctx = { initial_extension_switch_controls };
    63 
    64     _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor );
    65   }
     58  _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor );
    6659}
  • doc/user/init.t

    r36b86d7 ra853c851  
    158158mandatory.
    159159
     160@item RTEMS_SYSINIT_INITIAL_EXTENSIONS
     161Initializes the initial extensions if at least one is configured by the Board
     162Support Package or application.
     163
    160164@item RTEMS_SYSINIT_DATA_STRUCTURES
    161165This directive is called when the Board Support Package has completed its basic
    162166initialization and allows RTEMS to initialize the application environment based
    163167upon the information in the Configuration Table, User Initialization Tasks
    164 Table, Device Driver Table, User Extension Table, Multiprocessor Configuration
    165 Table, and the Multiprocessor Communications Interface (MPCI) Table.
     168Table, Device Driver Table, Multiprocessor Configuration Table, and the
     169Multiprocessor Communications Interface (MPCI) Table.
    166170
    167171@item RTEMS_SYSINIT_BSP_LIBC
  • testsuites/sptests/spsysinit01/init.c

    r36b86d7 ra853c851  
    2727#include <rtems/score/apimutex.h>
    2828#include <rtems/score/sysstate.h>
     29#include <rtems/score/userextimpl.h>
    2930#include <rtems/score/wkspace.h>
    3031
     
    3637  BSP_START_PRE,
    3738  BSP_START_POST,
     39  INITIAL_EXTENSIONS_PRE,
     40  INITIAL_EXTENSIONS_POST,
    3841  DATA_STRUCTURES_PRE,
    3942  DATA_STRUCTURES_POST,
     
    107110}
    108111
     112FIRST(RTEMS_SYSINIT_INITIAL_EXTENSIONS)
     113{
     114  assert(_Chain_Is_empty(&_User_extensions_Switches_list));
     115  next_step(INITIAL_EXTENSIONS_PRE);
     116}
     117
     118LAST(RTEMS_SYSINIT_INITIAL_EXTENSIONS)
     119{
     120  assert(!_Chain_Is_empty(&_User_extensions_Switches_list));
     121  next_step(INITIAL_EXTENSIONS_POST);
     122}
     123
    109124FIRST(RTEMS_SYSINIT_DATA_STRUCTURES)
    110125{
     
    206221#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    207222
     223#define CONFIGURE_STACK_CHECKER_ENABLED
     224
    208225#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
    209226
Note: See TracChangeset for help on using the changeset viewer.