Ticket #1253: head-constructor-managers.diff

File head-constructor-managers.diff, 58.5 KB (added by Chris Johns, on 08/23/07 at 00:08:03)

Proof of concept patch.

  • c/src/lib/libbsp/i386/pc386/startup/linkcmds

    RCS file: /usr1/CVS/rtems/c/src/lib/libbsp/i386/pc386/startup/linkcmds,v
    retrieving revision 1.17
    diff -u -r1.17 linkcmds
     
    5050    . = ALIGN (16);
    5151
    5252    /*
     53     * Special RTEMS Kernel constructor sections.
     54     */
     55    . = ALIGN (16);
     56    __start_set_rtems_ctor = .;
     57    *(set_rtems_ctor*);
     58    __stop_set_rtems_ctor = ABSOLUTE(.);
     59    *(set_domain_*);
     60    *(set_pseudo_*);
     61
     62    /*
    5363     * Special FreeBSD sysctl sections.
    5464     */
    5565    . = ALIGN (16);
  • c/src/optman/rtems/no-barrier.c

    RCS file: /usr1/CVS/rtems/c/src/optman/rtems/no-barrier.c,v
    retrieving revision 1.1
    diff -u -r1.1 no-barrier.c
     
    1717#include <rtems/score/object.h>
    1818#include <rtems/rtems/barrier.h>
    1919
     20#if 0
    2021void _Barrier_Manager_initialization(
    2122  uint32_t   maximum_barriers
    2223)
    2324{
    2425}
     26#endif
  • c/src/optman/rtems/no-dpmem.c

    RCS file: /usr1/CVS/rtems/c/src/optman/rtems/no-dpmem.c,v
    retrieving revision 1.13
    diff -u -r1.13 no-dpmem.c
     
    2121#include <rtems/rtems/types.h>
    2222#include <rtems/rtems/dpmem.h>
    2323
     24#if 0
    2425void _Dual_ported_memory_Manager_initialization(
    2526  uint32_t   maximum_ports
    2627)
    2728{
    2829}
     30#endif
  • c/src/optman/rtems/no-event.c

    RCS file: /usr1/CVS/rtems/c/src/optman/rtems/no-event.c,v
    retrieving revision 1.13
    diff -u -r1.13 no-event.c
     
    2121#include <rtems/score/thread.h>
    2222#include <rtems/score/interr.h>
    2323
     24#if 0
    2425void _Event_Manager_initialization( void )
    2526{
    2627}
    27 
     28#endif
  • c/src/optman/rtems/no-msg.c

    RCS file: /usr1/CVS/rtems/c/src/optman/rtems/no-msg.c,v
    retrieving revision 1.17
    diff -u -r1.17 no-msg.c
     
    2525#include <rtems/score/wkspace.h>
    2626#include <rtems/score/interr.h>
    2727
     28#if 0
    2829void _Message_queue_Manager_initialization(
    2930  uint32_t   maximum_message_queues
    3031)
    3132{
    3233}
     34#endif
  • c/src/optman/rtems/no-part.c

    RCS file: /usr1/CVS/rtems/c/src/optman/rtems/no-part.c,v
    retrieving revision 1.14
    diff -u -r1.14 no-part.c
     
    2020#include <rtems/score/thread.h>
    2121#include <rtems/score/interr.h>
    2222
     23#if 0
    2324void _Partition_Manager_initialization(
    2425  uint32_t   maximum_partitions
    2526)
    2627{
    2728}
     29#endif
  • c/src/optman/rtems/no-region.c

    RCS file: /usr1/CVS/rtems/c/src/optman/rtems/no-region.c,v
    retrieving revision 1.15
    diff -u -r1.15 no-region.c
     
    2121#include <rtems/score/thread.h>
    2222#include <rtems/score/interr.h>
    2323
     24#if 0
    2425void _Region_Manager_initialization(
    2526  uint32_t   maximum_regions
    2627)
    2728{
    2829}
     30#endif
  • c/src/optman/rtems/no-rtmon.c

    RCS file: /usr1/CVS/rtems/c/src/optman/rtems/no-rtmon.c,v
    retrieving revision 1.13
    diff -u -r1.13 no-rtmon.c
     
    2222#include <rtems/rtems/types.h>
    2323#include <rtems/rtems/ratemon.h>
    2424
     25#if 0
    2526void _Rate_monotonic_Manager_initialization(
    2627  uint32_t   maximum_periods
    2728)
    2829{
    2930}
     31#endif
     32
  • c/src/optman/rtems/no-sem.c

    RCS file: /usr1/CVS/rtems/c/src/optman/rtems/no-sem.c,v
    retrieving revision 1.16
    diff -u -r1.16 no-sem.c
     
    2424#include <rtems/score/threadq.h>
    2525#include <rtems/score/interr.h>
    2626
     27#if 0
    2728void _Semaphore_Manager_initialization(
    2829  uint32_t   maximum_semaphores
    2930)
    3031{
    3132}
    3233
     34#endif
  • c/src/optman/rtems/no-timer.c

    RCS file: /usr1/CVS/rtems/c/src/optman/rtems/no-timer.c,v
    retrieving revision 1.13
    diff -u -r1.13 no-timer.c
     
    2323#include <rtems/rtems/types.h>
    2424#include <rtems/rtems/timer.h>
    2525
     26#if 0
    2627void _Timer_Manager_initialization(
    2728  uint32_t   maximum_timers
    2829)
    2930{
    3031}
    31 
     32#endif
  • cpukit/rtems/include/rtems/rtems/barrier.h

    RCS file: /usr1/CVS/rtems/cpukit/rtems/include/rtems/rtems/barrier.h,v
    retrieving revision 1.2
    diff -u -r1.2 barrier.h
     
    3535extern "C" {
    3636#endif
    3737
     38#include <rtems/config.h>
    3839#include <rtems/rtems/types.h>
    3940#include <rtems/rtems/support.h>
    4041#include <rtems/rtems/attr.h>
     
    7273 */
    7374
    7475void _Barrier_Manager_initialization(
    75   uint32_t   maximum_barriers
     76  rtems_api_configuration_table *api_configuration
    7677);
    7778
    7879/**
  • cpukit/rtems/include/rtems/rtems/config.h

    RCS file: /usr1/CVS/rtems/cpukit/rtems/include/rtems/rtems/config.h,v
    retrieving revision 1.11
    diff -u -r1.11 config.h
     
    2424#endif
    2525
    2626#include <rtems/rtems/types.h>
    27 #include <rtems/rtems/tasks.h>
     27
     28  struct rtems_initialization_tasks_table;
    2829
    2930/*
    3031 *  The following records define the Configuration Table.  The
     
    4647  uint32_t                    maximum_periods;
    4748  uint32_t                    maximum_barriers;
    4849  uint32_t                    number_of_initialization_tasks;
    49   rtems_initialization_tasks_table *User_initialization_tasks_table;
     50  struct rtems_initialization_tasks_table *User_initialization_tasks_table;
    5051} rtems_api_configuration_table;
    5152
    5253#ifdef __cplusplus
  • cpukit/rtems/include/rtems/rtems/dpmem.h

    RCS file: /usr1/CVS/rtems/cpukit/rtems/include/rtems/rtems/dpmem.h,v
    retrieving revision 1.16
    diff -u -r1.16 dpmem.h
     
    3838extern "C" {
    3939#endif
    4040
     41#include <rtems/config.h>
    4142#include <rtems/score/object.h>
    4243#include <rtems/rtems/support.h>
    4344#include <rtems/rtems/status.h>
     
    7071 */
    7172
    7273void _Dual_ported_memory_Manager_initialization(
    73   uint32_t   maximum_ports
     74  rtems_api_configuration_table *api_configuration
    7475);
    7576
    7677/*
  • cpukit/rtems/include/rtems/rtems/message.h

    RCS file: /usr1/CVS/rtems/cpukit/rtems/include/rtems/rtems/message.h,v
    retrieving revision 1.25
    diff -u -r1.25 message.h
     
    3939extern "C" {
    4040#endif
    4141
     42#include <rtems/config.h>
    4243#include <rtems/rtems/types.h>
    4344#include <rtems/rtems/status.h>
    4445#include <rtems/score/chain.h>
     
    7576
    7677RTEMS_MESSAGE_EXTERN Objects_Information  _Message_queue_Information;
    7778
    78 /*
    79  *  _Message_queue_Manager_initialization
    80  *
    81  *  DESCRIPTION:
     79/**
     80 *  @brief _Message_queue_Manager_initialization
    8281 *
    8382 *  This routine performs the initialization necessary for this manager.
     83 *
     84 *  @param[in] api_configuration is the classic API configuration and
     85 *             contains the maximum_message_queues. This is the number
     86 *             message queue that can be created.
    8487 */
    8588
    8689void _Message_queue_Manager_initialization(
    87   uint32_t   maximum_message_queues
     90  rtems_api_configuration_table *api_configuration
    8891);
    8992
    9093/*
  • cpukit/rtems/include/rtems/rtems/part.h

    RCS file: /usr1/CVS/rtems/cpukit/rtems/include/rtems/rtems/part.h,v
    retrieving revision 1.17
    diff -u -r1.17 part.h
     
    3737extern "C" {
    3838#endif
    3939
     40#include <rtems/config.h>
    4041#include <rtems/score/address.h>
    4142#include <rtems/score/object.h>
    4243#include <rtems/rtems/attr.h>
     
    7475 */
    7576
    7677void _Partition_Manager_initialization(
    77   uint32_t   maximum_partitions
     78  rtems_api_configuration_table *api_configuration
    7879);
    7980
    8081/*
  • cpukit/rtems/include/rtems/rtems/ratemon.h

    RCS file: /usr1/CVS/rtems/cpukit/rtems/include/rtems/rtems/ratemon.h,v
    retrieving revision 1.23
    diff -u -r1.23 ratemon.h
     
    5050  #define RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS
    5151#endif
    5252
     53#include <rtems/config.h>
    5354#include <rtems/score/object.h>
    5455#include <rtems/score/thread.h>
    5556#include <rtems/score/watchdog.h>
     
    161162 */
    162163
    163164void _Rate_monotonic_Manager_initialization(
    164   uint32_t   maximum_periods
     165  rtems_api_configuration_table *api_configuration
    165166);
    166167
    167168/*
  • cpukit/rtems/include/rtems/rtems/region.h

    RCS file: /usr1/CVS/rtems/cpukit/rtems/include/rtems/rtems/region.h,v
    retrieving revision 1.21
    diff -u -r1.21 region.h
     
    3838
    3939#include <stddef.h>
    4040
     41#include <rtems/config.h>
    4142#include <rtems/score/object.h>
    4243#include <rtems/score/threadq.h>
    4344#include <rtems/score/heap.h>
     
    8182 */
    8283
    8384void _Region_Manager_initialization(
    84   uint32_t   maximum_regions
     85  rtems_api_configuration_table *api_configuration
    8586);
    8687
    8788/*
  • cpukit/rtems/include/rtems/rtems/sem.h

    RCS file: /usr1/CVS/rtems/cpukit/rtems/include/rtems/rtems/sem.h,v
    retrieving revision 1.24
    diff -u -r1.24 sem.h
     
    3737extern "C" {
    3838#endif
    3939
     40#include <rtems/config.h>
    4041#include <rtems/rtems/types.h>
    4142#include <rtems/rtems/support.h>
    4243#include <rtems/rtems/tasks.h>
     
    7475 */
    7576
    7677void _Semaphore_Manager_initialization(
    77   uint32_t   maximum_semaphores
     78  rtems_api_configuration_table *api_configuration
    7879);
    7980
    8081/*
  • cpukit/rtems/include/rtems/rtems/tasks.h

    RCS file: /usr1/CVS/rtems/cpukit/rtems/include/rtems/rtems/tasks.h,v
    retrieving revision 1.31
    diff -u -r1.31 tasks.h
     
    4747#include <rtems/score/object.h>
    4848#include <rtems/score/states.h>
    4949#include <rtems/score/thread.h>
     50#include <rtems/rtems/config.h>
    5051#include <rtems/rtems/types.h>
    5152#include <rtems/rtems/eventset.h>
    5253#include <rtems/rtems/asr.h>
     
    142143 *  initialization time.
    143144 */
    144145
    145 typedef struct {
     146typedef struct rtems_initialization_tasks_table {
    146147  rtems_name            name;              /* task name */
    147148  size_t                stack_size;        /* task stack size */
    148149  rtems_task_priority   initial_priority;  /* task priority */
     
    181182 */
    182183
    183184void _RTEMS_tasks_Manager_initialization(
    184   uint32_t     maximum_tasks
     185  rtems_api_configuration_table *api_configuration
    185186);
    186187
    187188/*
  • cpukit/rtems/include/rtems/rtems/timer.h

    RCS file: /usr1/CVS/rtems/cpukit/rtems/include/rtems/rtems/timer.h,v
    retrieving revision 1.22
    diff -u -r1.22 timer.h
     
    4444extern "C" {
    4545#endif
    4646
     47#include <rtems/config.h>
    4748#include <rtems/score/object.h>
    4849#include <rtems/score/watchdog.h>
    4950#include <rtems/score/thread.h>
     
    124125 */
    125126
    126127void _Timer_Manager_initialization(
    127   uint32_t   maximum_timers
     128  rtems_api_configuration_table *api_configuration
    128129);
    129130
    130131/*
  • cpukit/rtems/src/barrier.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/barrier.c,v
    retrieving revision 1.1
    diff -u -r1.1 barrier.c
     
    3232#include <rtems/rtems/support.h>
    3333#include <rtems/score/object.h>
    3434#include <rtems/rtems/barrier.h>
     35#include <rtems/score/constructor.h>
    3536#if defined(RTEMS_MULTIPROCESSING)
    3637#include <rtems/score/mpci.h>
    3738#endif
     
    4041 *  @brief _Barrier_Manager_initialization
    4142 *
    4243 *  Input parameters:
    43  *    maximum_barriers - maximum configured barriers
     44 *    api_configuration - API configuration table.
    4445 *
    4546 *  Output parameters:  NONE
    4647 */
    4748
    4849void _Barrier_Manager_initialization(
    49   uint32_t   maximum_barriers
     50  rtems_api_configuration_table *api_configuration
    5051)
    5152{
    5253  _Objects_Initialize_information(
    53     &_Barrier_Information,         /* object information table */
    54     OBJECTS_CLASSIC_API,           /* object API */
    55     OBJECTS_RTEMS_BARRIERS,        /* object class */
    56     maximum_barriers,              /* maximum objects of this class */
    57     sizeof( Barrier_Control ),     /* size of this object's control block */
    58     FALSE,                         /* TRUE if the name is a string */
    59     RTEMS_MAXIMUM_NAME_LENGTH      /* maximum length of an object name */
     54    &_Barrier_Information,               /* object information table */
     55    OBJECTS_CLASSIC_API,                 /* object API */
     56    OBJECTS_RTEMS_BARRIERS,              /* object class */
     57    api_configuration->maximum_barriers, /* maximum objects of this class */
     58    sizeof( Barrier_Control ),           /* size of this object's control block */
     59    FALSE,                               /* TRUE if the name is a string */
     60    RTEMS_MAXIMUM_NAME_LENGTH            /* maximum length of an object name */
    6061#if defined(RTEMS_MULTIPROCESSING)
    6162    ,
    62     FALSE,                         /* TRUE if this is a global object class */
    63     NULL                           /* Proxy extraction support callout */
     63    FALSE,                               /* TRUE if this is a global object class */
     64    NULL                                 /* Proxy extraction support callout */
    6465#endif
    6566  );
    6667}
     68
     69RTEMS_CTOR( classic, barrier, 13, _Barrier_Manager_initialization);
  • cpukit/rtems/src/barriercreate.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/barriercreate.c,v
    retrieving revision 1.1
    diff -u -r1.1 barriercreate.c
     
    9090  _Thread_Enable_dispatch();
    9191  return RTEMS_SUCCESSFUL;
    9292}
     93
     94RTEMS_CTOR_REF( classic, barrier );
  • cpukit/rtems/src/dpmem.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/dpmem.c,v
    retrieving revision 1.19
    diff -u -r1.19 dpmem.c
     
    1818#include <rtems/system.h>
    1919#include <rtems/rtems/status.h>
    2020#include <rtems/rtems/support.h>
     21#include <rtems/score/constructor.h>
    2122#include <rtems/score/address.h>
    2223#include <rtems/rtems/dpmem.h>
    2324#include <rtems/score/object.h>
     
    3738 */
    3839
    3940void _Dual_ported_memory_Manager_initialization(
    40   uint32_t   maximum_ports
     41  rtems_api_configuration_table *api_configuration
    4142)
    4243{
    4344  _Objects_Initialize_information(
    4445    &_Dual_ported_memory_Information, /* object information table */
    4546    OBJECTS_CLASSIC_API,              /* object API */
    4647    OBJECTS_RTEMS_PORTS,              /* object class */
    47     maximum_ports,                    /* maximum objects of this class */
     48    api_configuration->maximum_ports, /* maximum objects of this class */
    4849    sizeof( Dual_ported_memory_Control ),
    4950                                  /* size of this object's control block */
    5051    FALSE,                        /* TRUE if names of this object are strings */
     
    5657#endif
    5758  );
    5859}
     60
     61RTEMS_CTOR( classic, dpmem, 11, _Dual_ported_memory_Manager_initialization );
  • cpukit/rtems/src/dpmemcreate.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/dpmemcreate.c,v
    retrieving revision 1.9
    diff -u -r1.9 dpmemcreate.c
     
    8686  _Thread_Enable_dispatch();
    8787  return RTEMS_SUCCESSFUL;
    8888}
     89
     90RTEMS_CTOR_REF( classic, dpmem );
  • cpukit/rtems/src/event.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/event.c,v
    retrieving revision 1.23
    diff -u -r1.23 event.c
     
    1818#include <rtems/system.h>
    1919#include <rtems/rtems/status.h>
    2020#include <rtems/rtems/event.h>
     21#include <rtems/score/constructor.h>
    2122#include <rtems/score/isr.h>
    2223#include <rtems/score/object.h>
    2324#include <rtems/rtems/options.h>
     
    4647  _MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet );
    4748#endif
    4849}
     50
     51RTEMS_CTOR( classic, events, 6, _Event_Manager_initialization );
  • cpukit/rtems/src/eventreceive.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/eventreceive.c,v
    retrieving revision 1.5
    diff -u -r1.5 eventreceive.c
     
    1818#include <rtems/system.h>
    1919#include <rtems/rtems/status.h>
    2020#include <rtems/rtems/event.h>
     21#include <rtems/score/constructor.h>
    2122#include <rtems/score/isr.h>
    2223#include <rtems/score/object.h>
    2324#include <rtems/rtems/options.h>
     
    6768  _Thread_Enable_dispatch();
    6869  return( _Thread_Executing->Wait.return_code );
    6970}
     71
     72RTEMS_CTOR_REF( classic, events );
  • cpukit/rtems/src/eventseize.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/eventseize.c,v
    retrieving revision 1.5
    diff -u -r1.5 eventseize.c
     
    1818#include <rtems/system.h>
    1919#include <rtems/rtems/status.h>
    2020#include <rtems/rtems/event.h>
     21#include <rtems/score/constructor.h>
    2122#include <rtems/score/isr.h>
    2223#include <rtems/score/object.h>
    2324#include <rtems/rtems/options.h>
     
    140141      return;
    141142  }
    142143}
     144
     145RTEMS_CTOR_REF( classic, events );
  • cpukit/rtems/src/eventsend.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/eventsend.c,v
    retrieving revision 1.5
    diff -u -r1.5 eventsend.c
     
    1818#include <rtems/system.h>
    1919#include <rtems/rtems/status.h>
    2020#include <rtems/rtems/event.h>
     21#include <rtems/score/constructor.h>
    2122#include <rtems/score/isr.h>
    2223#include <rtems/score/object.h>
    2324#include <rtems/rtems/options.h>
     
    7374
    7475  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
    7576}
     77
     78RTEMS_CTOR_REF( classic, events );
  • cpukit/rtems/src/eventsurrender.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/eventsurrender.c,v
    retrieving revision 1.8
    diff -u -r1.8 eventsurrender.c
     
    1818#include <rtems/system.h>
    1919#include <rtems/rtems/status.h>
    2020#include <rtems/rtems/event.h>
     21#include <rtems/score/constructor.h>
    2122#include <rtems/score/isr.h>
    2223#include <rtems/score/object.h>
    2324#include <rtems/rtems/options.h>
     
    109110  }
    110111  _ISR_Enable( level );
    111112}
     113
     114RTEMS_CTOR_REF( classic, events );
  • cpukit/rtems/src/intr.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/intr.c,v
    retrieving revision 1.14
    diff -u -r1.14 intr.c
     
    1717#endif
    1818
    1919#include <rtems/system.h>
     20#include <rtems/score/constructor.h>
    2021#include <rtems/rtems/status.h>
    2122#include <rtems/score/isr.h>
    2223#include <rtems/rtems/intr.h>
     
    3334void _Interrupt_Manager_initialization( void )
    3435{
    3536}
     37
     38RTEMS_CTOR( classic, interrupt, 1, _Interrupt_Manager_initialization );
  • cpukit/rtems/src/intrcatch.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/intrcatch.c,v
    retrieving revision 1.4
    diff -u -r1.4 intrcatch.c
     
    1717#endif
    1818
    1919#include <rtems/system.h>
     20#include <rtems/score/constructor.h>
    2021#include <rtems/rtems/status.h>
    2122#include <rtems/score/isr.h>
    2223#include <rtems/rtems/intr.h>
     
    5657
    5758  return RTEMS_SUCCESSFUL;
    5859}
     60
     61RTEMS_CTOR_REF( classic, interrupt );
  • cpukit/rtems/src/mp.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/mp.c,v
    retrieving revision 1.14
    diff -u -r1.14 mp.c
     
    1717#endif
    1818
    1919#include <rtems/system.h>
     20#include <rtems/score/constructor.h>
    2021#include <rtems/rtems/status.h>
    2122#include <rtems/rtems/mp.h>
    2223#include <rtems/score/mpci.h>
     
    4243  _MPCI_Announce();
    4344}
    4445
     46
     47#if defined(RTEMS_MULTIPROCESSING)
     48RTEMS_CTOR( classic, multiprocessing, 2, _Multiprocessing_Manager_initialization );
     49#endif
     50
    4551/* end of file */
  • cpukit/rtems/src/msg.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/msg.c,v
    retrieving revision 1.30
    diff -u -r1.30 msg.c
     
    2525#include <rtems/score/states.h>
    2626#include <rtems/score/thread.h>
    2727#include <rtems/score/wkspace.h>
     28#include <rtems/score/constructor.h>
    2829#if defined(RTEMS_MULTIPROCESSING)
    2930#include <rtems/score/mpci.h>
    3031#endif
     
    4243 *  data structures.
    4344 *
    4445 *  Input parameters:
    45  *    maximum_message_queues - number of message queues to initialize
     46 *    api_configuration - API configuration table.
    4647 *
    4748 *  Output parameters:  NONE
    4849 */
    4950
    5051void _Message_queue_Manager_initialization(
    51   uint32_t   maximum_message_queues
     52  rtems_api_configuration_table *api_configuration
    5253)
    5354{
    5455  _Objects_Initialize_information(
    55     &_Message_queue_Information,  /* object information table */
    56     OBJECTS_CLASSIC_API,          /* object API */
    57     OBJECTS_RTEMS_MESSAGE_QUEUES, /* object class */
    58     maximum_message_queues,       /* maximum objects of this class */
    59     sizeof( Message_queue_Control ),
    60                                /* size of this object's control block */
    61     FALSE,                     /* TRUE if names of this object are strings */
    62     RTEMS_MAXIMUM_NAME_LENGTH  /* maximum length of each object's name */
     56    &_Message_queue_Information,               /* object information table */
     57    OBJECTS_CLASSIC_API,                       /* object API */
     58    OBJECTS_RTEMS_MESSAGE_QUEUES,              /* object class */
     59    api_configuration->maximum_message_queues, /* maximum objects of this class */
     60    sizeof( Message_queue_Control ),           /* size of this object's control block */
     61    FALSE,                             /* TRUE if names of this object are strings */
     62    RTEMS_MAXIMUM_NAME_LENGTH          /* maximum length of each object's name */
    6363#if defined(RTEMS_MULTIPROCESSING)
    6464    ,
    65     TRUE,                      /* TRUE if this is a global object class */
    66     _Message_queue_MP_Send_extract_proxy  /* Proxy extraction support callout */
     65    TRUE,                                      /* TRUE if this is a global object class */
     66    _Message_queue_MP_Send_extract_proxy       /* Proxy extraction support callout */
    6767#endif
    6868  );
    6969
     
    7979#endif
    8080
    8181}
     82
     83RTEMS_CTOR( classic, message_queue, 7, _Message_queue_Manager_initialization);
  • cpukit/rtems/src/msgqcreate.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/msgqcreate.c,v
    retrieving revision 1.11
    diff -u -r1.11 msgqcreate.c
     
    2020#include <rtems/score/sysstate.h>
    2121#include <rtems/score/chain.h>
    2222#include <rtems/score/isr.h>
     23#include <rtems/score/constructor.h>
    2324#include <rtems/score/coremsg.h>
    2425#include <rtems/score/object.h>
    2526#include <rtems/score/states.h>
     
    163164  _Thread_Enable_dispatch();
    164165  return RTEMS_SUCCESSFUL;
    165166}
     167
     168RTEMS_CTOR_REF( classic, message_queue );
  • cpukit/rtems/src/part.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/part.c,v
    retrieving revision 1.21
    diff -u -r1.21 part.c
     
    1919#include <rtems/system.h>
    2020#include <rtems/rtems/status.h>
    2121#include <rtems/rtems/support.h>
     22#include <rtems/score/constructor.h>
    2223#include <rtems/score/address.h>
    2324#include <rtems/score/object.h>
    2425#include <rtems/rtems/part.h>
     
    3940 */
    4041
    4142void _Partition_Manager_initialization(
    42   uint32_t   maximum_partitions
     43  rtems_api_configuration_table *api_configuration
    4344)
    4445{
    4546  _Objects_Initialize_information(
    46     &_Partition_Information,     /* object information table */
    47     OBJECTS_CLASSIC_API,         /* object API */
    48     OBJECTS_RTEMS_PARTITIONS,    /* object class */
    49     maximum_partitions,          /* maximum objects of this class */
    50     sizeof( Partition_Control ), /* size of this object's control block */
    51     FALSE,                       /* TRUE if the name is a string */
    52     RTEMS_MAXIMUM_NAME_LENGTH    /* maximum length of an object name */
     47    &_Partition_Information,               /* object information table */
     48    OBJECTS_CLASSIC_API,                   /* object API */
     49    OBJECTS_RTEMS_PARTITIONS,              /* object class */
     50    api_configuration->maximum_partitions, /* maximum objects of this class */
     51    sizeof( Partition_Control ),           /* size of this object's control block */
     52    FALSE,                                 /* TRUE if the name is a string */
     53    RTEMS_MAXIMUM_NAME_LENGTH              /* maximum length of an object name */
    5354#if defined(RTEMS_MULTIPROCESSING)
    5455    ,
    5556    TRUE,                        /* TRUE if this is a global object class */
     
    6970#endif
    7071
    7172}
     73
     74RTEMS_CTOR( classic, partition, 9, _Partition_Manager_initialization );
  • cpukit/rtems/src/partcreate.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/partcreate.c,v
    retrieving revision 1.9
    diff -u -r1.9 partcreate.c
     
    2020#include <rtems/rtems/status.h>
    2121#include <rtems/rtems/support.h>
    2222#include <rtems/score/address.h>
     23#include <rtems/score/constructor.h>
    2324#include <rtems/score/object.h>
    2425#include <rtems/rtems/part.h>
    2526#include <rtems/score/thread.h>
     
    127128  _Thread_Enable_dispatch();
    128129  return RTEMS_SUCCESSFUL;
    129130}
     131
     132RTEMS_CTOR_REF( classic, partition );
  • cpukit/rtems/src/ratemon.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/ratemon.c,v
    retrieving revision 1.22
    diff -u -r1.22 ratemon.c
     
    1919#include <rtems/system.h>
    2020#include <rtems/rtems/status.h>
    2121#include <rtems/rtems/support.h>
     22#include <rtems/score/constructor.h>
    2223#include <rtems/score/isr.h>
    2324#include <rtems/score/object.h>
    2425#include <rtems/rtems/ratemon.h>
     
    4142 */
    4243
    4344void _Rate_monotonic_Manager_initialization(
    44   uint32_t   maximum_periods
     45  rtems_api_configuration_table *api_configuration
    4546)
    4647{
    4748  _Objects_Initialize_information(
    48     &_Rate_monotonic_Information,     /* object information table */
    49     OBJECTS_CLASSIC_API,              /* object API */
    50     OBJECTS_RTEMS_PERIODS,            /* object class */
    51     maximum_periods,                  /* maximum objects of this class */
    52     sizeof( Rate_monotonic_Control ), /* size of this object's control block */
    53     FALSE,                            /* TRUE if the name is a string */
    54     RTEMS_MAXIMUM_NAME_LENGTH         /* maximum length of an object name */
     49    &_Rate_monotonic_Information,       /* object information table */
     50    OBJECTS_CLASSIC_API,                /* object API */
     51    OBJECTS_RTEMS_PERIODS,              /* object class */
     52    api_configuration->maximum_periods, /* maximum objects of this class */
     53    sizeof( Rate_monotonic_Control ),   /* size of this object's control block */
     54    FALSE,                              /* TRUE if the name is a string */
     55    RTEMS_MAXIMUM_NAME_LENGTH           /* maximum length of an object name */
    5556#if defined(RTEMS_MULTIPROCESSING)
    5657    ,
    5758    FALSE,                     /* TRUE if this is a global object class */
     
    5960#endif
    6061  );
    6162}
     63
     64RTEMS_CTOR( classic, ratemon, 12, _Rate_monotonic_Manager_initialization );
  • cpukit/rtems/src/ratemoncreate.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/ratemoncreate.c,v
    retrieving revision 1.9
    diff -u -r1.9 ratemoncreate.c
     
    1818#include <rtems/system.h>
    1919#include <rtems/rtems/status.h>
    2020#include <rtems/rtems/support.h>
     21#include <rtems/score/constructor.h>
    2122#include <rtems/score/isr.h>
    2223#include <rtems/score/object.h>
    2324#include <rtems/rtems/ratemon.h>
     
    7980  _Thread_Enable_dispatch();
    8081  return RTEMS_SUCCESSFUL;
    8182}
     83
     84RTEMS_CTOR_REF( classic, ratemon );
  • cpukit/rtems/src/region.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/region.c,v
    retrieving revision 1.25
    diff -u -r1.25 region.c
     
    1919#include <rtems/system.h>
    2020#include <rtems/rtems/status.h>
    2121#include <rtems/rtems/support.h>
     22#include <rtems/score/constructor.h>
    2223#include <rtems/score/object.h>
    2324#include <rtems/rtems/options.h>
    2425#include <rtems/rtems/region.h>
     
    3940 */
    4041
    4142void _Region_Manager_initialization(
    42   uint32_t   maximum_regions
     43  rtems_api_configuration_table *api_configuration
    4344)
    4445{
    4546  _Objects_Initialize_information(
    46     &_Region_Information,      /* object information table */
    47     OBJECTS_CLASSIC_API,       /* object API */
    48     OBJECTS_RTEMS_REGIONS,     /* object class */
    49     maximum_regions,          /* maximum objects of this class */
    50     sizeof( Region_Control ),  /* size of this object's control block */
    51     FALSE,                     /* TRUE if the name is a string */
    52     RTEMS_MAXIMUM_NAME_LENGTH  /* maximum length of an object name */
     47    &_Region_Information,               /* object information table */
     48    OBJECTS_CLASSIC_API,                /* object API */
     49    OBJECTS_RTEMS_REGIONS,              /* object class */
     50    api_configuration->maximum_regions, /* maximum objects of this class */
     51    sizeof( Region_Control ),           /* size of this object's control block */
     52    FALSE,                              /* TRUE if the name is a string */
     53    RTEMS_MAXIMUM_NAME_LENGTH           /* maximum length of an object name */
    5354#if defined(RTEMS_MULTIPROCESSING)
    5455    ,
    5556    FALSE,                     /* TRUE if this is a global object class */
     
    6970#endif
    7071
    7172}
     73
     74RTEMS_CTOR( classic, regions, 10, _Region_Manager_initialization );
  • cpukit/rtems/src/regioncreate.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/regioncreate.c,v
    retrieving revision 1.9
    diff -u -r1.9 regioncreate.c
     
    1919#include <rtems/system.h>
    2020#include <rtems/rtems/status.h>
    2121#include <rtems/rtems/support.h>
     22#include <rtems/score/constructor.h>
    2223#include <rtems/score/object.h>
    2324#include <rtems/rtems/options.h>
    2425#include <rtems/rtems/region.h>
     
    112113  _RTEMS_Unlock_allocator();
    113114  return RTEMS_SUCCESSFUL;
    114115}
     116
     117RTEMS_CTOR_REF( classic, regions );
  • cpukit/rtems/src/rtemstimer.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/rtemstimer.c,v
    retrieving revision 1.22
    diff -u -r1.22 rtemstimer.c
     
    1919#include <rtems/system.h>
    2020#include <rtems/rtems/status.h>
    2121#include <rtems/rtems/support.h>
     22#include <rtems/score/constructor.h>
    2223#include <rtems/score/object.h>
    2324#include <rtems/score/thread.h>
    2425#include <rtems/rtems/timer.h>
     
    3839 */
    3940
    4041void _Timer_Manager_initialization(
    41   uint32_t   maximum_timers
     42  rtems_api_configuration_table *api_configuration
    4243)
    4344{
    4445  _Objects_Initialize_information(
    45     &_Timer_Information,       /* object information table */
    46     OBJECTS_CLASSIC_API,       /* object API */
    47     OBJECTS_RTEMS_TIMERS,      /* object class */
    48     maximum_timers,            /* maximum objects of this class */
    49     sizeof( Timer_Control ),   /* size of this object's control block */
    50     FALSE,                     /* TRUE if the name is a string */
    51     RTEMS_MAXIMUM_NAME_LENGTH  /* maximum length of an object name */
     46    &_Timer_Information,               /* object information table */
     47    OBJECTS_CLASSIC_API,               /* object API */
     48    OBJECTS_RTEMS_TIMERS,              /* object class */
     49    api_configuration->maximum_timers, /* maximum objects of this class */
     50    sizeof( Timer_Control ),           /* size of this object's control block */
     51    FALSE,                             /* TRUE if the name is a string */
     52    RTEMS_MAXIMUM_NAME_LENGTH          /* maximum length of an object name */
    5253#if defined(RTEMS_MULTIPROCESSING)
    5354    ,
    5455    FALSE,                     /* TRUE if this is a global object class */
     
    6364
    6465  _Timer_Server = NULL;
    6566}
     67
     68RTEMS_CTOR( classic, timers, 4, _Timer_Manager_initialization );
  • cpukit/rtems/src/sem.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/sem.c,v
    retrieving revision 1.26
    diff -u -r1.26 sem.c
     
    3333#include <rtems/rtems/status.h>
    3434#include <rtems/rtems/support.h>
    3535#include <rtems/rtems/attr.h>
     36#include <rtems/score/constructor.h>
    3637#include <rtems/score/isr.h>
    3738#include <rtems/score/object.h>
    3839#include <rtems/rtems/options.h>
     
    6263 */
    6364
    6465void _Semaphore_Manager_initialization(
    65   uint32_t   maximum_semaphores
     66  rtems_api_configuration_table *api_configuration
    6667)
    6768{
    6869  _Objects_Initialize_information(
    69     &_Semaphore_Information,     /* object information table */
    70     OBJECTS_CLASSIC_API,         /* object API */
    71     OBJECTS_RTEMS_SEMAPHORES,    /* object class */
    72     maximum_semaphores,          /* maximum objects of this class */
    73     sizeof( Semaphore_Control ), /* size of this object's control block */
    74     FALSE,                       /* TRUE if the name is a string */
    75     RTEMS_MAXIMUM_NAME_LENGTH    /* maximum length of an object name */
     70    &_Semaphore_Information,               /* object information table */
     71    OBJECTS_CLASSIC_API,                   /* object API */
     72    OBJECTS_RTEMS_SEMAPHORES,              /* object class */
     73    api_configuration->maximum_semaphores, /* maximum objects of this class */
     74    sizeof( Semaphore_Control ),           /* size of this object's control block */
     75    FALSE,                                 /* TRUE if the name is a string */
     76    RTEMS_MAXIMUM_NAME_LENGTH              /* maximum length of an object name */
    7677#if defined(RTEMS_MULTIPROCESSING)
    7778    ,
    7879    TRUE,                        /* TRUE if this is a global object class */
     
    9293#endif
    9394
    9495}
     96
     97RTEMS_CTOR( classic, semaphore, 8, _Semaphore_Manager_initialization );
  • cpukit/rtems/src/semcreate.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/semcreate.c,v
    retrieving revision 1.16
    diff -u -r1.16 semcreate.c
     
    3333#include <rtems/rtems/status.h>
    3434#include <rtems/rtems/support.h>
    3535#include <rtems/rtems/attr.h>
     36#include <rtems/score/constructor.h>
    3637#include <rtems/score/isr.h>
    3738#include <rtems/score/object.h>
    3839#include <rtems/rtems/options.h>
     
    228229  _Thread_Enable_dispatch();
    229230  return RTEMS_SUCCESSFUL;
    230231}
     232
     233RTEMS_CTOR_REF( classic, semaphore );
  • cpukit/rtems/src/signal.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/signal.c,v
    retrieving revision 1.16
    diff -u -r1.16 signal.c
     
    1919#include <rtems/system.h>
    2020#include <rtems/rtems/status.h>
    2121#include <rtems/rtems/asr.h>
     22#include <rtems/score/constructor.h>
    2223#include <rtems/score/isr.h>
    2324#include <rtems/rtems/modes.h>
    2425#include <rtems/rtems/signal.h>
     
    4950  );
    5051#endif
    5152}
     53
     54RTEMS_CTOR( classic, signals, 5, _Signal_Manager_initialization );
  • cpukit/rtems/src/signalcatch.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/signalcatch.c,v
    retrieving revision 1.5
    diff -u -r1.5 signalcatch.c
     
    1919#include <rtems/system.h>
    2020#include <rtems/rtems/status.h>
    2121#include <rtems/rtems/asr.h>
     22#include <rtems/score/constructor.h>
    2223#include <rtems/score/isr.h>
    2324#include <rtems/rtems/modes.h>
    2425#include <rtems/rtems/signal.h>
     
    6768  _Thread_Enable_dispatch();
    6869  return RTEMS_SUCCESSFUL;
    6970}
     71
     72RTEMS_CTOR_REF( classic, signals );
  • cpukit/rtems/src/signalsend.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/signalsend.c,v
    retrieving revision 1.5
    diff -u -r1.5 signalsend.c
     
    1919#include <rtems/system.h>
    2020#include <rtems/rtems/status.h>
    2121#include <rtems/rtems/asr.h>
     22#include <rtems/score/constructor.h>
    2223#include <rtems/score/isr.h>
    2324#include <rtems/rtems/modes.h>
    2425#include <rtems/rtems/signal.h>
     
    9293
    9394  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
    9495}
     96
     97RTEMS_CTOR_REF( classic, signals );
  • cpukit/rtems/src/taskcreate.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/taskcreate.c,v
    retrieving revision 1.12
    diff -u -r1.12 taskcreate.c
     
    2020#include <rtems/rtems/status.h>
    2121#include <rtems/rtems/support.h>
    2222#include <rtems/rtems/modes.h>
     23#include <rtems/score/constructor.h>
    2324#include <rtems/score/object.h>
    2425#include <rtems/score/stack.h>
    2526#include <rtems/score/states.h>
     
    228229  _Thread_Enable_dispatch();
    229230  return RTEMS_SUCCESSFUL;
    230231}
     232
     233RTEMS_CTOR_REF( classic, tasks );
  • cpukit/rtems/src/tasks.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/tasks.c,v
    retrieving revision 1.51
    diff -u -r1.51 tasks.c
     
    1919#include <rtems/rtems/status.h>
    2020#include <rtems/rtems/support.h>
    2121#include <rtems/rtems/modes.h>
     22#include <rtems/score/constructor.h>
    2223#include <rtems/score/object.h>
    2324#include <rtems/score/stack.h>
    2425#include <rtems/score/states.h>
     
    242243 */
    243244
    244245void _RTEMS_tasks_Manager_initialization(
    245   uint32_t                          maximum_tasks
     246  rtems_api_configuration_table *api_configuration
    246247)
    247248{
    248249
    249250  _Objects_Initialize_information(
    250     &_RTEMS_tasks_Information, /* object information table */
    251     OBJECTS_CLASSIC_API,       /* object API */
    252     OBJECTS_RTEMS_TASKS,       /* object class */
    253     maximum_tasks,            /* maximum objects of this class */
    254     sizeof( Thread_Control ),  /* size of this object's control block */
    255     FALSE,                     /* TRUE if the name is a string */
    256     RTEMS_MAXIMUM_NAME_LENGTH  /* maximum length of an object name */
     251    &_RTEMS_tasks_Information,        /* object information table */
     252    OBJECTS_CLASSIC_API,              /* object API */
     253    OBJECTS_RTEMS_TASKS,              /* object class */
     254    api_configuration->maximum_tasks, /* maximum objects of this class */
     255    sizeof( Thread_Control ),         /* size of this object's control block */
     256    FALSE,                            /* TRUE if the name is a string */
     257    RTEMS_MAXIMUM_NAME_LENGTH         /* maximum length of an object name */
    257258#if defined(RTEMS_MULTIPROCESSING)
    258259    ,
    259260    TRUE,                      /* TRUE if this is a global object class */
     
    300301  if ( _RTEMS_tasks_Initialize_user_tasks_p )
    301302    (*_RTEMS_tasks_Initialize_user_tasks_p)();
    302303}
     304
     305RTEMS_CTOR( classic, tasks, 3, _RTEMS_tasks_Manager_initialization );
  • cpukit/rtems/src/timercreate.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/timercreate.c,v
    retrieving revision 1.9
    diff -u -r1.9 timercreate.c
     
    1919#include <rtems/system.h>
    2020#include <rtems/rtems/status.h>
    2121#include <rtems/rtems/support.h>
     22#include <rtems/score/constructor.h>
    2223#include <rtems/score/object.h>
    2324#include <rtems/score/thread.h>
    2425#include <rtems/rtems/timer.h>
     
    7677  _Thread_Enable_dispatch();
    7778  return RTEMS_SUCCESSFUL;
    7879}
     80
     81RTEMS_CTOR_REF( classic, timers );
  • cpukit/sapi/src/exinit.c

    RCS file: /usr1/CVS/rtems/cpukit/sapi/src/exinit.c,v
    retrieving revision 1.39
    diff -u -r1.39 exinit.c
     
    3434
    3535#include <rtems/score/apiext.h>
    3636#include <rtems/score/apimutex.h>
     37#include <rtems/score/constructor.h>
    3738#include <rtems/score/copyrt.h>
    3839#include <rtems/score/heap.h>
    3940#include <rtems/score/interr.h>
  • cpukit/sapi/src/rtemsapi.c

    RCS file: /usr1/CVS/rtems/cpukit/sapi/src/rtemsapi.c,v
    retrieving revision 1.16
    diff -u -r1.16 rtemsapi.c
     
    4545#include <rtems/rtems/signal.h>
    4646#include <rtems/rtems/timer.h>
    4747
     48#include <rtems/score/constructor.h>
     49
     50RTEMS_CTOR_ROOT( classic, 0 );
     51
    4852Objects_Information *_RTEMS_Objects[ OBJECTS_RTEMS_CLASSES_LAST + 1 ];
    4953
     54RTEMS_CTOR_SET_DECLARE( );
     55
     56void _CORE_constructor_Find_Nodes(
     57  CORE_constructor_Node *parent,
     58  int depth
     59)
     60{
     61  CORE_constructor_Node **nodep;
     62  CORE_constructor_Node *node;
     63
     64  if (depth > 32)
     65  {
     66    _Internal_error_Occurred( INTERNAL_ERROR_CORE, TRUE, INTERNAL_ERROR_INVALID_NODE );
     67  }
     68 
     69  for (nodep = RTEMS_CTOR_SET_BEGIN( ); nodep != RTEMS_CTOR_SET_END( ); nodep++)
     70  {
     71    node = *nodep;
     72    if (node->parent == parent)
     73    {
     74      CORE_constructor_Node **prev = &parent->children;
     75
     76      while (*prev)
     77      {
     78        if ((node != *prev) && (*prev)->order >= node->order)
     79        {
     80          node->next = *prev;
     81          *prev = node;
     82          break;
     83        }
     84        else
     85        {
     86          prev = &((*prev)->next);
     87        }
     88      }
     89
     90      if (*prev == 0)
     91      {
     92        node->next = *prev;
     93        *prev = node;
     94      }
     95    }
     96  }
     97
     98  node = parent->children;
     99  while (node)
     100  {
     101    _CORE_constructor_Find_Nodes( node, ++depth );
     102    node = node->next;
     103  }
     104}
     105
     106void _CORE_constructor_Invoke(
     107  CORE_constructor_Node *parent,
     108  void *data
     109)
     110{
     111  CORE_constructor_Node *node = parent->children;
     112
     113  /*
     114   * Only invoke the parent's handler if it is the top of the
     115   * of the tree.
     116   */
     117  if ((parent->parent == 0) && parent->handler)
     118    parent->handler( data );
     119
     120  while (node)
     121  {
     122    if (node->handler)
     123      node->handler( data );
     124    node = node->next;
     125  }
     126}
     127
     128/**
     129 *  Call the kernel constructors for a specific family of
     130 *  constructors.
     131 */
     132
     133void _CORE_construct(
     134  CORE_constructor_Node *top,
     135  void *data
     136)
     137{
     138  /*
     139   * Create the tree of nodes from this top.
     140   */
     141  _CORE_constructor_Find_Nodes( top, 0 );
     142
     143  /*
     144   * Invoke the constructors in order from top to bottom.
     145   */
     146  _CORE_constructor_Invoke( top, data );
     147}
     148
    50149/*PAGE
    51150 *
    52151 *  _RTEMS_API_Initialize
     
    64163
    65164  _Objects_Information_table[OBJECTS_CLASSIC_API] = _RTEMS_Objects;
    66165
     166  /*
     167   * The attribute handler is not a function rather a macro so
     168   * cannot make it a constructor.
     169   */
    67170  _Attributes_Handler_initialization();
    68171
    69   _Interrupt_Manager_initialization();
    70 
    71 #if defined(RTEMS_MULTIPROCESSING)
    72   _Multiprocessing_Manager_initialization();
    73 #endif
    74 
    75   _RTEMS_tasks_Manager_initialization( api_configuration->maximum_tasks );
    76 
    77   _Timer_Manager_initialization( api_configuration->maximum_timers );
    78 
    79   _Signal_Manager_initialization();
    80 
    81   _Event_Manager_initialization();
    82 
    83   _Message_queue_Manager_initialization(
    84     api_configuration->maximum_message_queues
    85   );
    86 
    87   _Semaphore_Manager_initialization( api_configuration->maximum_semaphores );
    88 
    89   _Partition_Manager_initialization( api_configuration->maximum_partitions );
    90 
    91   _Region_Manager_initialization( api_configuration->maximum_regions );
    92 
    93   _Dual_ported_memory_Manager_initialization( api_configuration->maximum_ports);
    94 
    95   _Rate_monotonic_Manager_initialization( api_configuration->maximum_periods );
    96 
    97   _Barrier_Manager_initialization( api_configuration->maximum_barriers );
     172  _CORE_construct( &RTEMS_CTOR_NODE_PARENT( classic ), api_configuration );
    98173}
    99174
    100175/* end of file */
  • cpukit/score/Makefile.am

    RCS file: /usr1/CVS/rtems/cpukit/score/Makefile.am,v
    retrieving revision 1.46
    diff -u -r1.46 Makefile.am
     
    1919include_rtems_score_HEADERS = include/rtems/score/address.h \
    2020    include/rtems/score/apiext.h include/rtems/score/apimutex.h \
    2121    include/rtems/score/bitfield.h include/rtems/score/chain.h \
     22    include/rtems/score/constructor.h \
    2223    include/rtems/score/context.h include/rtems/score/copyrt.h \
    2324    include/rtems/score/corebarrier.h include/rtems/score/coremsg.h \
    2425    include/rtems/score/coremutex.h include/rtems/score/corerwlock.h \
  • cpukit/score/preinstall.am

    RCS file: /usr1/CVS/rtems/cpukit/score/preinstall.am,v
    retrieving revision 1.13
    diff -u -r1.13 preinstall.am
     
    5555        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/chain.h
    5656PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/chain.h
    5757
     58$(PROJECT_INCLUDE)/rtems/score/constructor.h: include/rtems/score/constructor.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
     59        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/constructor.h
     60PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/constructor.h
     61
    5862$(PROJECT_INCLUDE)/rtems/score/context.h: include/rtems/score/context.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
    5963        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/context.h
    6064PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/context.h
  • new file cpukit/score/include/rtems/score/constructor.h

    RCS file: cpukit/score/include/rtems/score/constructor.h
    diff -N cpukit/score/include/rtems/score/constructor.h
    - +  
     1/**
     2 *  @file  rtems/score/constructor.h
     3 *
     4 *  This include file contains all the constants and structures associated
     5 *  with the construction of services by placing into a structured table
     6 *  elements to be called by the kernel. It is based on the sysctl
     7 *  system in the BSD kernel.
     8 */
     9
     10/*
     11 *  COPYRIGHT (c) 2007.
     12 *  Chris Johns (chrisj@rtems.org)
     13 *
     14 *  The license and distribution terms for this file may be
     15 *  found in the file LICENSE in this distribution or at
     16 *  http://www.rtems.com/license/LICENSE.
     17 *
     18 *  $Id: isr.h,v 1.25 2006/03/07 20:47:53 joel Exp $
     19 */
     20
     21#ifndef _RTEMS_SCORE_CONSTRUCTOR_H
     22#define _RTEMS_SCORE_CONSTRUCTOR_H
     23
     24/**
     25 *  @defgroup Core Constructor.
     26 *
     27 *  This code encapsulates functionality which provides the foundation
     28 *  for Core construction of services to allow link time binding of
     29 *  resources in the kernel.
     30 */
     31/**@{*/
     32
     33#ifdef __cplusplus
     34extern "C" {
     35#endif
     36
     37/**
     38 * The type of handler invoked when constructing.
     39 */
     40typedef void ( *CORE_constructor )( void * );
     41
     42/**
     43 *  The following type defines the control block used to manage
     44 *  the interrupt level portion of the status register.
     45 */
     46typedef struct _CORE_constructor_Node {
     47  /**
     48   * Children point to the parent create the tree of nodes with no
     49   * downward dependence.
     50   */
     51  const struct _CORE_constructor_Node *parent;
     52
     53  /**
     54   * Children of this node.
     55   */
     56  struct _CORE_constructor_Node *children;
     57
     58  /**
     59   * Nodes with a common parent.
     60   */
     61  struct _CORE_constructor_Node *next;
     62
     63  /**
     64   * The order this node is started in. Zero (0) means do not care.
     65   */
     66  uint8_t order;
     67
     68  /**
     69   * The handler invoked when constructing.
     70   */
     71  CORE_constructor handler;
     72
     73} CORE_constructor_Node;
     74
     75/*
     76 * Private macros, not to be used outside this header file. Taken from
     77 * the BSD header file 'linker_set.h'.
     78 *
     79 * The variables are not static as gcc will not output the variable
     80 * is unused. No attribute exists to say it is used like you can
     81 * for variables.
     82 */
     83#ifdef __GNUC__
     84#define __force volatile
     85#define __weak __attribute__ ((weak))
     86#define __unused __attribute__ ((used))
     87#define __used
     88#define RTEMS_CORE_SET(sym) \
     89  CORE_constructor_Node const * const __set_rtems_ctor_sym_##sym \
     90  __attribute__(( section("set_rtems_ctor") )) __used = &sym
     91#else
     92#error "This file needs to be compiled by GCC or lint"
     93#endif
     94
     95/**
     96 * 
     97 */
     98#define RTEMS_CTOR_NODE_PARENT( parent ) \
     99  rtems_ctor_##parent##_children
     100
     101/**
     102 *  The following declares a static node which children can be added.
     103 */
     104#define RTEMS_CTOR_DECL( name ) \
     105  SCORE_EXTERN CORE_constructor_Node RTEMS_CTOR_NODE_PARENT( name )
     106
     107/**
     108 * 
     109 */
     110#define RTEMS_CTOR_NODE_CHILDREN( parent, name ) \
     111  rtems_ctor_##parent##_##name##_children
     112
     113/**
     114 * 
     115 */
     116#define RTEMS_CTOR_SYM( parent, name ) \
     117  rtems_ctor__##parent##_##name
     118
     119/**
     120 * 
     121 */
     122#define RTEMS_CTOR( parent, name, order, handler ) \
     123  CORE_constructor_Node RTEMS_CTOR_SYM( parent, name ) = { \
     124    &RTEMS_CTOR_NODE_PARENT( parent ), 0, 0, order, \
     125    (CORE_constructor) handler }; \
     126  RTEMS_CORE_SET( rtems_ctor__##parent##_##name )
     127
     128/**
     129 * 
     130 */
     131#define RTEMS_CTOR_ROOT( name, handler ) \
     132  CORE_constructor_Node RTEMS_CTOR_NODE_PARENT( name ) = { \
     133    0, 0, 0, 0, (CORE_constructor) handler };              \
     134  RTEMS_CORE_SET( rtems_ctor_##name##_children )
     135
     136/**
     137 * 
     138 */
     139#define RTEMS_CTOR_REF( parent, name ) \
     140  extern CORE_constructor_Node RTEMS_CTOR_SYM( parent, name ); \
     141    __force __weak __unused CORE_constructor_Node *RTEMS_CTOR_NODE_CHILDREN( parent, name ) = \
     142    &RTEMS_CTOR_SYM( parent, name )
     143
     144/**
     145 *
     146 */
     147#define RTEMS_CTOR_SET_DECLARE( ) \
     148        extern CORE_constructor_Node *__start_set_rtems_ctor[]; \
     149        extern CORE_constructor_Node *__stop_set_rtems_ctor[]
     150
     151/**
     152 *
     153 */
     154#define RTEMS_CTOR_SET_BEGIN( ) (__start_set_rtems_ctor)
     155#define RTEMS_CTOR_SET_END( )   (__stop_set_rtems_ctor)
     156
     157/*
     158 * Place here as a hack until placed into the correct location.
     159 */
     160RTEMS_CTOR_DECL( classic );
     161
     162#ifdef __cplusplus
     163}
     164#endif
     165
     166/**@}*/
     167
     168#endif
     169/* end of include file */
  • new file cpukit/score/include/rtems/score/linker_set.h

    RCS file: cpukit/score/include/rtems/score/linker_set.h
    diff -N cpukit/score/include/rtems/score/linker_set.h
    - +  
     1/*-
     2 * Copyright (c) 1999 John D. Polstra
     3 * Copyright (c) 1999,2001 Peter Wemm <peter@FreeBSD.org>
     4 * All rights reserved.
     5 *
     6 * Redistribution and use in source and binary forms, with or without
     7 * modification, are permitted provided that the following conditions
     8 * are met:
     9 * 1. Redistributions of source code must retain the above copyright
     10 *    notice, this list of conditions and the following disclaimer.
     11 * 2. Redistributions in binary form must reproduce the above copyright
     12 *    notice, this list of conditions and the following disclaimer in the
     13 *    documentation and/or other materials provided with the distribution.
     14 *
     15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     18 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     25 * SUCH DAMAGE.
     26 *
     27 * $FreeBSD: src/sys/sys/linker_set.h,v 1.13 2002/09/23 06:11:29 peter Exp $
     28 */
     29
     30#ifndef _SYS_LINKER_SET_H_
     31#define _SYS_LINKER_SET_H_
     32
     33/*
     34 * The following macros are used to declare global sets of objects, which
     35 * are collected by the linker into a `linker_set' as defined below.
     36 * For ELF, this is done by constructing a separate segment for each set.
     37 */
     38
     39/*
     40 * Private macros, not to be used outside this header file.
     41 */
     42#ifdef __GNUC__
     43#define __MAKE_SET(set, sym)                                            \
     44        static void const * const __set_##set##_sym_##sym               \
     45        __attribute((section("set_" #set))) __used = &sym
     46#else /* !__GNUC__ */
     47#ifndef lint
     48#error "This file needs to be compiled by GCC or lint"
     49#endif /* lint */
     50#define __MAKE_SET(set, sym)    extern void const * const (__set_##set##_sym_##sym)
     51#endif /* __GNUC__ */
     52
     53/*
     54 * Public macros.
     55 */
     56#define TEXT_SET(set, sym)      __MAKE_SET(set, sym)
     57#define DATA_SET(set, sym)      __MAKE_SET(set, sym)
     58#define BSS_SET(set, sym)       __MAKE_SET(set, sym)
     59#define ABS_SET(set, sym)       __MAKE_SET(set, sym)
     60#define SET_ENTRY(set, sym)     __MAKE_SET(set, sym)
     61
     62/*
     63 * Initialize before referring to a give linker set
     64 */
     65#define SET_DECLARE(set, ptype)                                         \
     66        extern ptype *__CONCAT(__start_set_,set)[];                     \
     67        extern ptype *__CONCAT(__stop_set_,set)[]
     68
     69#define SET_BEGIN(set)                                                  \
     70        (__CONCAT(__start_set_,set))
     71#define SET_LIMIT(set)                                                  \
     72        (__CONCAT(__stop_set_,set))
     73
     74/*
     75 * Iterate over all the elements of a set.
     76 *
     77 * Sets always contain addresses of things, and "pvar" points to words
     78 * containing those addresses.  Thus is must be declared as "type **pvar",
     79 * and the address of each set item is obtained inside the loop by "*pvar".
     80 */
     81#define SET_FOREACH(pvar, set)                                          \
     82        for (pvar = SET_BEGIN(set); pvar < SET_LIMIT(set); pvar++)
     83
     84#define SET_ITEM(set, i)                                                \
     85        ((SET_BEGIN(set))[i])
     86
     87/*
     88 * Provide a count of the items in a set.
     89 */
     90#define SET_COUNT(set)                                                  \
     91        (SET_LIMIT(set) - SET_BEGIN(set))
     92
     93#endif  /* _SYS_LINKER_SET_H_ */