Changeset 21275b58 in rtems for cpukit/rtems


Ignore:
Timestamp:
Nov 22, 2018, 6:14:51 PM (12 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
6b0a729b
Parents:
0f5b2c09
git-author:
Sebastian Huber <sebastian.huber@…> (11/22/18 18:14:51)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/14/18 06:03:29)
Message:

score: Static Objects_Information initialization

Statically allocate the objects information together with the initial
set of objects either via <rtems/confdefs.h>. Provide default object
informations with zero objects via librtemscpu.a. This greatly
simplifies the workspace size estimate. RTEMS applications which do not
use the unlimited objects option are easier to debug since all objects
reside now in statically allocated objects of the right types.

Close #3621.

Location:
cpukit/rtems/src
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/barrier.c

    r0f5b2c09 r21275b58  
    22 * @file
    33 *
    4  * @brief RTEMS Barrier Manager Initialization
    5  * @ingroup ClassicBarrier Barriers
     4 * @ingroup ClassicBarrier
     5 *
     6 * @brief Classic Barrier Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2015.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/barrierimpl.h>
     40#include <rtems/rtems/barrierdata.h>
    2741
    28 Objects_Information _Barrier_Information;
    29 
    30 /**
    31  *  @brief _Barrier_Manager_initialization
    32  */
    33 static void _Barrier_Manager_initialization(void)
    34 {
    35   _Objects_Initialize_information(
    36     &_Barrier_Information,         /* object information table */
    37     OBJECTS_CLASSIC_API,           /* object API */
    38     OBJECTS_RTEMS_BARRIERS,        /* object class */
    39     Configuration_RTEMS_API.maximum_barriers,
    40                                    /* maximum objects of this class */
    41     sizeof( Barrier_Control ),     /* size of this object's control block */
    42     OBJECTS_NO_STRING_NAME,        /* maximum length of an object name */
    43     NULL                           /* Proxy extraction support callout */
    44   );
    45 }
    46 
    47 RTEMS_SYSINIT_ITEM(
    48   _Barrier_Manager_initialization,
    49   RTEMS_SYSINIT_CLASSIC_BARRIER,
    50   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Barrier,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_BARRIERS,
     46  OBJECTS_NO_STRING_NAME
    5147);
  • cpukit/rtems/src/barriercreate.c

    r0f5b2c09 r21275b58  
    1919#endif
    2020
    21 #include <rtems/system.h>
     21#include <rtems/rtems/barrierimpl.h>
    2222#include <rtems/rtems/status.h>
    2323#include <rtems/rtems/support.h>
    2424#include <rtems/rtems/attrimpl.h>
    2525#include <rtems/score/isr.h>
    26 #include <rtems/rtems/barrierimpl.h>
    27 
    28 /*
    29  *  rtems_barrier_create
    30  *
    31  *  This directive creates a barrier.  A barrier id is returned.
    32  *
    33  *  Input parameters:
    34  *    name             - user defined barrier name
    35  *    attribute_set    - barrier attributes
    36  *    maximum_waiters  - number of threads before automatic release
    37  *    priority_ceiling - barrier's ceiling priority
    38  *    id               - pointer to barrier id
    39  *
    40  *  Output parameters:
    41  *    id               - barrier id
    42  *    RTEMS_SUCCESSFUL - if successful
    43  *    error code       - if unsuccessful
    44  */
     26#include <rtems/sysinit.h>
    4527
    4628rtems_status_code rtems_barrier_create(
     
    9173  return RTEMS_SUCCESSFUL;
    9274}
     75
     76static void _Barrier_Manager_initialization( void )
     77{
     78  _Objects_Initialize_information( &_Barrier_Information );
     79}
     80
     81RTEMS_SYSINIT_ITEM(
     82  _Barrier_Manager_initialization,
     83  RTEMS_SYSINIT_CLASSIC_BARRIER,
     84  RTEMS_SYSINIT_ORDER_MIDDLE
     85);
  • cpukit/rtems/src/dpmem.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Dual Ported Memory Manager Initialization
    5  *  @ingroup ClassicDPMEM
     4 * @ingroup ClassicDPMEM
     5 *
     6 * @brief Classic Dual Ported Memory Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/dpmemimpl.h>
     40#include <rtems/rtems/dpmemdata.h>
    2741
    28 Objects_Information _Dual_ported_memory_Information;
    29 
    30 static void _Dual_ported_memory_Manager_initialization(void)
    31 {
    32   _Objects_Initialize_information(
    33     &_Dual_ported_memory_Information, /* object information table */
    34     OBJECTS_CLASSIC_API,              /* object API */
    35     OBJECTS_RTEMS_PORTS,              /* object class */
    36     Configuration_RTEMS_API.maximum_ports,
    37                                   /* maximum objects of this class */
    38     sizeof( Dual_ported_memory_Control ),
    39                                   /* size of this object's control block */
    40     OBJECTS_NO_STRING_NAME,       /* maximum length of an object name */
    41     NULL                          /* Proxy extraction support callout */
    42   );
    43 }
    44 
    45 RTEMS_SYSINIT_ITEM(
    46   _Dual_ported_memory_Manager_initialization,
    47   RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY,
    48   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Dual_ported_memory,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_PORTS,
     46  OBJECTS_NO_STRING_NAME
    4947);
  • cpukit/rtems/src/dpmemcreate.c

    r0f5b2c09 r21275b58  
    1919#endif
    2020
    21 #include <rtems/system.h>
     21#include <rtems/rtems/dpmemimpl.h>
    2222#include <rtems/rtems/status.h>
    2323#include <rtems/rtems/support.h>
    2424#include <rtems/score/address.h>
    25 #include <rtems/rtems/dpmemimpl.h>
    2625#include <rtems/score/thread.h>
     26#include <rtems/sysinit.h>
    2727
    2828rtems_status_code rtems_port_create(
     
    6767  return RTEMS_SUCCESSFUL;
    6868}
     69
     70static void _Dual_ported_memory_Manager_initialization( void )
     71{
     72  _Objects_Initialize_information( &_Dual_ported_memory_Information );
     73}
     74
     75RTEMS_SYSINIT_ITEM(
     76  _Dual_ported_memory_Manager_initialization,
     77  RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY,
     78  RTEMS_SYSINIT_ORDER_MIDDLE
     79);
  • cpukit/rtems/src/msg.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Message Queue Manager Initialization
    5  *  @ingroup ClassicMessageQueue
     4 * @ingroup ClassicMessageQueue
     5 *
     6 * @brief Classic Message Queue Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/attrimpl.h>
    26 #include <rtems/rtems/messageimpl.h>
    27 #include <rtems/rtems/options.h>
    28 #include <rtems/rtems/support.h>
     40#include <rtems/rtems/messagedata.h>
    2941
    30 Objects_Information _Message_queue_Information;
    31 
    32 static void _Message_queue_Manager_initialization(void)
    33 {
    34   _Objects_Initialize_information(
    35     &_Message_queue_Information,  /* object information table */
    36     OBJECTS_CLASSIC_API,          /* object API */
    37     OBJECTS_RTEMS_MESSAGE_QUEUES, /* object class */
    38     Configuration_RTEMS_API.maximum_message_queues,
    39                                   /* maximum objects of this class */
    40     sizeof( Message_queue_Control ),
    41                                   /* size of this object's control block */
    42     OBJECTS_NO_STRING_NAME,       /* maximum length of an object name */
    43     _Message_queue_MP_Send_extract_proxy
    44                                   /* Proxy extraction support callout */
    45   );
    46 
    47   /*
    48    *  Register the MP Process Packet routine.
    49    */
    50 
    51 #if defined(RTEMS_MULTIPROCESSING)
    52   _MPCI_Register_packet_processor(
    53     MP_PACKET_MESSAGE_QUEUE,
    54     _Message_queue_MP_Process_packet
    55   );
    56 #endif
    57 
    58 }
    59 
    60 RTEMS_SYSINIT_ITEM(
    61   _Message_queue_Manager_initialization,
    62   RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE,
    63   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Message_queue,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_MESSAGE_QUEUES,
     46  OBJECTS_NO_STRING_NAME
    6447);
  • cpukit/rtems/src/msgqcreate.c

    r0f5b2c09 r21275b58  
    1919#endif
    2020
    21 #include <rtems/system.h>
     21#include <rtems/rtems/messageimpl.h>
     22#include <rtems/rtems/status.h>
     23#include <rtems/rtems/attrimpl.h>
     24#include <rtems/rtems/options.h>
     25#include <rtems/rtems/support.h>
    2226#include <rtems/score/sysstate.h>
    2327#include <rtems/score/chain.h>
     
    2630#include <rtems/score/thread.h>
    2731#include <rtems/score/wkspace.h>
    28 #include <rtems/rtems/status.h>
    29 #include <rtems/rtems/attrimpl.h>
    30 #include <rtems/rtems/messageimpl.h>
    31 #include <rtems/rtems/options.h>
    32 #include <rtems/rtems/support.h>
     32#include <rtems/sysinit.h>
    3333
    3434rtems_status_code rtems_message_queue_create(
     
    144144  return RTEMS_SUCCESSFUL;
    145145}
     146
     147static void _Message_queue_Manager_initialization(void)
     148{
     149   _Objects_Initialize_information( &_Message_queue_Information);
     150
     151  /*
     152   *  Register the MP Process Packet routine.
     153   */
     154
     155#if defined(RTEMS_MULTIPROCESSING)
     156  _MPCI_Register_packet_processor(
     157    MP_PACKET_MESSAGE_QUEUE,
     158    _Message_queue_MP_Process_packet
     159  );
     160#endif
     161
     162}
     163
     164RTEMS_SYSINIT_ITEM(
     165  _Message_queue_Manager_initialization,
     166  RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE,
     167  RTEMS_SYSINIT_ORDER_MIDDLE
     168);
  • cpukit/rtems/src/part.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Partition Manager Initialization
    5  *  @ingroup ClassicPart
     4 * @ingroup ClassicPart
     5 *
     6 * @brief Classic Partition Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/partimpl.h>
     40#include <rtems/rtems/partdata.h>
    2741
    28 Objects_Information _Partition_Information;
    29 
    30 static void _Partition_Manager_initialization(void)
    31 {
    32   _Objects_Initialize_information(
    33     &_Partition_Information,     /* object information table */
    34     OBJECTS_CLASSIC_API,         /* object API */
    35     OBJECTS_RTEMS_PARTITIONS,    /* object class */
    36     Configuration_RTEMS_API.maximum_partitions,
    37                                  /* maximum objects of this class */
    38     sizeof( Partition_Control ), /* size of this object's control block */
    39     OBJECTS_NO_STRING_NAME,      /* maximum length of an object name */
    40     _Partition_MP_Send_extract_proxy  /* Proxy extraction support callout */
    41   );
    42 
    43   /*
    44    *  Register the MP Process Packet routine.
    45    */
    46 
    47 #if defined(RTEMS_MULTIPROCESSING)
    48   _MPCI_Register_packet_processor(
    49     MP_PACKET_PARTITION,
    50     _Partition_MP_Process_packet
    51   );
    52 #endif
    53 
    54 }
    55 
    56 RTEMS_SYSINIT_ITEM(
    57   _Partition_Manager_initialization,
    58   RTEMS_SYSINIT_CLASSIC_PARTITION,
    59   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Partition,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_PARTITIONS,
     46  OBJECTS_NO_STRING_NAME
    6047);
  • cpukit/rtems/src/partcreate.c

    r0f5b2c09 r21275b58  
    2424#include <rtems/score/threaddispatch.h>
    2525#include <rtems/score/sysstate.h>
     26#include <rtems/sysinit.h>
    2627
    27 /*
    28  *  rtems_partition_create
    29  *
    30  *  This directive creates a partiton of fixed sized buffers from the
    31  *  given contiguous memory area.
    32  *
    33  *  Input parameters:
    34  *    name             - user defined partition name
    35  *    starting_address - physical start address of partition
    36  *    length           - physical length in bytes
    37  *    buffer_size      - size of buffers in bytes
    38  *    attribute_set    - partition attributes
    39  *    id               - pointer to partition id
    40  *
    41  *  Output parameters:
    42  *    id               - partition id
    43  *    RTEMS_SUCCESSFUL - if successful
    44  *    error code       - if unsuccessful
    45  */
    4628
    4729rtems_status_code rtems_partition_create(
     
    134116  return RTEMS_SUCCESSFUL;
    135117}
     118
     119static void _Partition_Manager_initialization(void)
     120{
     121  _Objects_Initialize_information( &_Partition_Information );
     122
     123  /*
     124   *  Register the MP Process Packet routine.
     125   */
     126
     127#if defined(RTEMS_MULTIPROCESSING)
     128  _MPCI_Register_packet_processor(
     129    MP_PACKET_PARTITION,
     130    _Partition_MP_Process_packet
     131  );
     132#endif
     133
     134}
     135
     136RTEMS_SYSINIT_ITEM(
     137  _Partition_Manager_initialization,
     138  RTEMS_SYSINIT_CLASSIC_PARTITION,
     139  RTEMS_SYSINIT_ORDER_MIDDLE
     140);
  • cpukit/rtems/src/ratemon.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Rate Monotonic Manager Initialization
    5  *  @ingroup ClassicRateMon
     4 * @ingroup ClassicRateMon
     5 *
     6 * @brief Classic Rate Monotonic Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/ratemonimpl.h>
     40#include <rtems/rtems/ratemondata.h>
    2741
    28 Objects_Information _Rate_monotonic_Information;
    29 
    30 static void _Rate_monotonic_Manager_initialization(void)
    31 {
    32   _Objects_Initialize_information(
    33     &_Rate_monotonic_Information,    /* object information table */
    34     OBJECTS_CLASSIC_API,             /* object API */
    35     OBJECTS_RTEMS_PERIODS,           /* object class */
    36     Configuration_RTEMS_API.maximum_periods,
    37                                      /* maximum objects of this class */
    38     sizeof( Rate_monotonic_Control ),/* size of this object's control block */
    39     OBJECTS_NO_STRING_NAME,          /* maximum length of an object name */
    40     NULL                             /* Proxy extraction support callout */
    41   );
    42 }
    43 
    44 RTEMS_SYSINIT_ITEM(
    45   _Rate_monotonic_Manager_initialization,
    46   RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC,
    47   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Rate_monotonic,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_PERIODS,
     46  OBJECTS_NO_STRING_NAME
    4847);
  • cpukit/rtems/src/ratemoncreate.c

    r0f5b2c09 r21275b58  
    1919#endif
    2020
    21 #include <rtems/system.h>
     21#include <rtems/rtems/ratemonimpl.h>
    2222#include <rtems/rtems/status.h>
    2323#include <rtems/rtems/support.h>
    2424#include <rtems/score/isr.h>
    25 #include <rtems/rtems/ratemonimpl.h>
    2625#include <rtems/score/thread.h>
    2726#include <rtems/score/watchdogimpl.h>
    28 
    29 /*
    30  *  rtems_rate_monotonic_create
    31  *
    32  *  This directive creates a rate monotonic timer and performs
    33  *  some initialization.
    34  *
    35  *  Input parameters:
    36  *    name - name of period
    37  *    id   - pointer to rate monotonic id
    38  *
    39  *  Output parameters:
    40  *    id               - rate monotonic id
    41  *    RTEMS_SUCCESSFUL - if successful
    42  *    error code       - if unsuccessful
    43  */
     27#include <rtems/sysinit.h>
    4428
    4529rtems_status_code rtems_rate_monotonic_create(
     
    8569  return RTEMS_SUCCESSFUL;
    8670}
     71
     72static void _Rate_monotonic_Manager_initialization( void )
     73{
     74  _Objects_Initialize_information( &_Rate_monotonic_Information );
     75}
     76
     77RTEMS_SYSINIT_ITEM(
     78  _Rate_monotonic_Manager_initialization,
     79  RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC,
     80  RTEMS_SYSINIT_ORDER_MIDDLE
     81);
  • cpukit/rtems/src/region.c

    r0f5b2c09 r21275b58  
    22 * @file
    33 *
    4  * @brief _Region_Manager_initialization
    5  * @ingroup ClassicRegion Regions
     4 * @ingroup ClassicRegion
     5 *
     6 * @brief Classic Region Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2013.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/options.h>
    27 #include <rtems/rtems/regionimpl.h>
     40#include <rtems/rtems/regiondata.h>
    2841
    29 Objects_Information _Region_Information;
    30 
    31 /*
    32  *  _Region_Manager_initialization
    33  *
    34  *  This routine initializes all region manager related data structures.
    35  *
    36  *  Input parameters:   NONE
    37  *
    38  *  Output parameters:  NONE
    39  */
    40 
    41 static void _Region_Manager_initialization(void)
    42 {
    43   _Objects_Initialize_information(
    44     &_Region_Information,      /* object information table */
    45     OBJECTS_CLASSIC_API,       /* object API */
    46     OBJECTS_RTEMS_REGIONS,     /* object class */
    47     Configuration_RTEMS_API.maximum_regions,
    48                                /* maximum objects of this class */
    49     sizeof( Region_Control ),  /* size of this object's control block */
    50     OBJECTS_NO_STRING_NAME,    /* maximum length of an object name */
    51     NULL                       /* Proxy extraction support callout */
    52   );
    53 }
    54 
    55 RTEMS_SYSINIT_ITEM(
    56   _Region_Manager_initialization,
    57   RTEMS_SYSINIT_CLASSIC_REGION,
    58   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Region,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_REGIONS,
     46  OBJECTS_NO_STRING_NAME
    5947);
  • cpukit/rtems/src/regioncreate.c

    r0f5b2c09 r21275b58  
    2424#include <rtems/score/apimutex.h>
    2525#include <rtems/score/threadqimpl.h>
    26 
    27 /*
    28  *  rtems_region_create
    29  *
    30  *  This directive creates a region of physical contiguous memory area
    31  *  from which variable sized segments can be allocated.
    32  *
    33  *  Input parameters:
    34  *    name             - user defined region name
    35  *    starting_address - physical start address of region
    36  *    length           - physical length in bytes
    37  *    page_size        - page size in bytes
    38  *    attribute_set    - region attributes
    39  *    id               - address of region id to set
    40  *
    41  *  Output parameters:
    42  *    id               - region id
    43  *    RTEMS_SUCCESSFUL - if successful
    44  *    error code       - if unsuccessful
    45  */
     26#include <rtems/sysinit.h>
    4627
    4728rtems_status_code rtems_region_create(
     
    10586  return return_status;
    10687}
     88
     89static void _Region_Manager_initialization( void )
     90{
     91  _Objects_Initialize_information( &_Region_Information );
     92}
     93
     94RTEMS_SYSINIT_ITEM(
     95  _Region_Manager_initialization,
     96  RTEMS_SYSINIT_CLASSIC_REGION,
     97  RTEMS_SYSINIT_ORDER_MIDDLE
     98);
  • cpukit/rtems/src/rtemstimer.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Timer Manager Initialization
    5  *  @ingroup ClassicTimer
     4 * @ingroup ClassicTimer
     5 *
     6 * @brief Classic Timer Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/system.h>
    22 #include <rtems/config.h>
    23 #include <rtems/sysinit.h>
    24 #include <rtems/rtems/status.h>
    25 #include <rtems/rtems/support.h>
    26 #include <rtems/rtems/timerimpl.h>
     40#include <rtems/rtems/timerdata.h>
    2741
    28 Timer_server_Control *volatile _Timer_server;
    29 
    30 Objects_Information  _Timer_Information;
    31 
    32 static void _Timer_Manager_initialization(void)
    33 {
    34   _Objects_Initialize_information(
    35     &_Timer_Information,       /* object information table */
    36     OBJECTS_CLASSIC_API,       /* object API */
    37     OBJECTS_RTEMS_TIMERS,      /* object class */
    38     Configuration_RTEMS_API.maximum_timers ,
    39                                /* maximum objects of this class */
    40     sizeof( Timer_Control ),   /* size of this object's control block */
    41     OBJECTS_NO_STRING_NAME,    /* maximum length of an object name */
    42     NULL                       /* Proxy extraction support callout */
    43   );
    44 }
    45 
    46 RTEMS_SYSINIT_ITEM(
    47   _Timer_Manager_initialization,
    48   RTEMS_SYSINIT_CLASSIC_TIMER,
    49   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Timer,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_TIMERS,
     46  OBJECTS_NO_STRING_NAME
    5047);
  • cpukit/rtems/src/sem.c

    r0f5b2c09 r21275b58  
    11/**
    2  *  @file
     2 * @file
    33 *
    4  *  @brief Semaphore Manager Initialization
    5  *  @ingroup ClassicSem
     4 * @ingroup ClassicSem
     5 *
     6 * @brief Classic Semaphore Information with Zero Objects
    67 */
    78
    89/*
    9  *  COPYRIGHT (c) 1989-2008.
    10  *  On-Line Applications Research Corporation (OAR).
     10 * SPDX-License-Identifier: BSD-2-Clause
    1111 *
    12  *  The license and distribution terms for this file may be
    13  *  found in the file LICENSE in this distribution or at
    14  *  http://www.rtems.org/license/LICENSE.
     12 * Copyright (C) 2018 embedded brains GmbH
     13 *
     14 * Redistribution and use in source and binary forms, with or without
     15 * modification, are permitted provided that the following conditions
     16 * are met:
     17 * 1. Redistributions of source code must retain the above copyright
     18 *    notice, this list of conditions and the following disclaimer.
     19 * 2. Redistributions in binary form must reproduce the above copyright
     20 *    notice, this list of conditions and the following disclaimer in the
     21 *    documentation and/or other materials provided with the distribution.
     22 *
     23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
     27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33 * POSSIBILITY OF SUCH DAMAGE.
    1534 */
    1635
     
    1938#endif
    2039
    21 #include <rtems/config.h>
    22 #include <rtems/sysinit.h>
    23 #include <rtems/rtems/semimpl.h>
     40#include <rtems/rtems/semdata.h>
    2441
    25 Objects_Information _Semaphore_Information;
    26 
    27 static void _Semaphore_Manager_initialization(void)
    28 {
    29   _Objects_Initialize_information(
    30     &_Semaphore_Information,     /* object information table */
    31     OBJECTS_CLASSIC_API,         /* object API */
    32     OBJECTS_RTEMS_SEMAPHORES,    /* object class */
    33      Configuration_RTEMS_API.maximum_semaphores,
    34                                  /* maximum objects of this class */
    35     sizeof( Semaphore_Control ), /* size of this object's control block */
    36     OBJECTS_NO_STRING_NAME,      /* maximum length of an object name */
    37     _Semaphore_MP_Send_extract_proxy /* Proxy extraction support callout */
    38   );
    39 
    40   /*
    41    *  Register the MP Process Packet routine.
    42    */
    43 
    44 #if defined(RTEMS_MULTIPROCESSING)
    45   _MPCI_Register_packet_processor(
    46     MP_PACKET_SEMAPHORE,
    47     _Semaphore_MP_Process_packet
    48   );
    49 #endif
    50 
    51 }
    52 
    53 RTEMS_SYSINIT_ITEM(
    54   _Semaphore_Manager_initialization,
    55   RTEMS_SYSINIT_CLASSIC_SEMAPHORE,
    56   RTEMS_SYSINIT_ORDER_MIDDLE
     42OBJECTS_INFORMATION_DEFINE_ZERO(
     43  _Semaphore,
     44  OBJECTS_CLASSIC_API,
     45  OBJECTS_RTEMS_SEMAPHORES,
     46  OBJECTS_NO_STRING_NAME
    5747);
  • cpukit/rtems/src/semcreate.c

    r0f5b2c09 r21275b58  
    2626#include <rtems/score/schedulerimpl.h>
    2727#include <rtems/score/sysstate.h>
     28#include <rtems/sysinit.h>
    2829
    2930#define SEMAPHORE_KIND_MASK ( RTEMS_SEMAPHORE_CLASS | RTEMS_INHERIT_PRIORITY \
     
    255256  return RTEMS_SUCCESSFUL;
    256257}
     258
     259static void _Semaphore_Manager_initialization(void)
     260{
     261  _Objects_Initialize_information( &_Semaphore_Information );
     262
     263#if defined(RTEMS_MULTIPROCESSING)
     264  _MPCI_Register_packet_processor(
     265    MP_PACKET_SEMAPHORE,
     266    _Semaphore_MP_Process_packet
     267  );
     268#endif
     269}
     270
     271RTEMS_SYSINIT_ITEM(
     272  _Semaphore_Manager_initialization,
     273  RTEMS_SYSINIT_CLASSIC_SEMAPHORE,
     274  RTEMS_SYSINIT_ORDER_MIDDLE
     275);
  • cpukit/rtems/src/taskcreate.c

    r0f5b2c09 r21275b58  
    2121#include <rtems/rtems/tasksimpl.h>
    2222#include <rtems/rtems/attrimpl.h>
     23#include <rtems/rtems/eventimpl.h>
    2324#include <rtems/rtems/modesimpl.h>
    2425#include <rtems/rtems/support.h>
     
    2728#include <rtems/score/sysstate.h>
    2829#include <rtems/score/threadimpl.h>
     30#include <rtems/score/userextimpl.h>
     31#include <rtems/sysinit.h>
    2932
    3033rtems_status_code rtems_task_create(
     
    199202  return RTEMS_SUCCESSFUL;
    200203}
     204
     205static void _RTEMS_tasks_Start_extension(
     206  Thread_Control *executing,
     207  Thread_Control *started
     208)
     209{
     210  RTEMS_API_Control *api;
     211
     212  api = started->API_Extensions[ THREAD_API_RTEMS ];
     213
     214  _Event_Initialize( &api->Event );
     215  _Event_Initialize( &api->System_event );
     216}
     217
     218#if defined(RTEMS_MULTIPROCESSING)
     219static void _RTEMS_tasks_Terminate_extension( Thread_Control *executing )
     220{
     221  if ( executing->is_global ) {
     222    _Objects_MP_Close(
     223      &_RTEMS_tasks_Information.Objects,
     224      executing->Object.id
     225    );
     226    _RTEMS_tasks_MP_Send_process_packet(
     227      RTEMS_TASKS_MP_ANNOUNCE_DELETE,
     228      executing->Object.id,
     229      0                                /* Not used */
     230    );
     231  }
     232}
     233#endif
     234
     235static User_extensions_Control _RTEMS_tasks_User_extensions = {
     236  .Callouts = {
     237#if defined(RTEMS_MULTIPROCESSING)
     238    .thread_terminate = _RTEMS_tasks_Terminate_extension,
     239#endif
     240    .thread_start     = _RTEMS_tasks_Start_extension,
     241    .thread_restart   = _RTEMS_tasks_Start_extension
     242  }
     243};
     244
     245static void _RTEMS_tasks_Manager_initialization(void)
     246{
     247  _Thread_Initialize_information( &_RTEMS_tasks_Information );
     248  _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );
     249
     250#if defined(RTEMS_MULTIPROCESSING)
     251  _MPCI_Register_packet_processor(
     252    MP_PACKET_TASKS,
     253    _RTEMS_tasks_MP_Process_packet
     254  );
     255#endif
     256}
     257
     258RTEMS_SYSINIT_ITEM(
     259  _RTEMS_tasks_Manager_initialization,
     260  RTEMS_SYSINIT_CLASSIC_TASKS,
     261  RTEMS_SYSINIT_ORDER_MIDDLE
     262);
  • cpukit/rtems/src/tasks.c

    r0f5b2c09 r21275b58  
    1919#endif
    2020
    21 #include <rtems/config.h>
    22 #include <rtems/sysinit.h>
    23 #include <rtems/rtems/eventimpl.h>
    24 #include <rtems/rtems/tasksimpl.h>
    25 #include <rtems/score/threadimpl.h>
    26 #include <rtems/score/userextimpl.h>
     21#include <rtems/rtems/tasksdata.h>
    2722
    28 Thread_Information _RTEMS_tasks_Information;
    29 
    30 static void _RTEMS_tasks_Start_extension(
    31   Thread_Control *executing,
    32   Thread_Control *started
    33 )
    34 {
    35   RTEMS_API_Control *api;
    36 
    37   api = started->API_Extensions[ THREAD_API_RTEMS ];
    38 
    39   _Event_Initialize( &api->Event );
    40   _Event_Initialize( &api->System_event );
    41 }
    42 
    43 #if defined(RTEMS_MULTIPROCESSING)
    44 static void _RTEMS_tasks_Terminate_extension( Thread_Control *executing )
    45 {
    46   if ( executing->is_global ) {
    47     _Objects_MP_Close(
    48       &_RTEMS_tasks_Information.Objects,
    49       executing->Object.id
    50     );
    51     _RTEMS_tasks_MP_Send_process_packet(
    52       RTEMS_TASKS_MP_ANNOUNCE_DELETE,
    53       executing->Object.id,
    54       0                                /* Not used */
    55     );
    56   }
    57 }
    58 #endif
    59 
    60 User_extensions_Control _RTEMS_tasks_User_extensions = {
    61   .Callouts = {
    62 #if defined(RTEMS_MULTIPROCESSING)
    63     .thread_terminate = _RTEMS_tasks_Terminate_extension,
    64 #endif
    65     .thread_start     = _RTEMS_tasks_Start_extension,
    66     .thread_restart   = _RTEMS_tasks_Start_extension
    67   }
    68 };
    69 
    70 static void _RTEMS_tasks_Manager_initialization(void)
    71 {
    72   _Thread_Initialize_information(
    73     &_RTEMS_tasks_Information, /* object information table */
    74     OBJECTS_CLASSIC_API,       /* object API */
    75     OBJECTS_RTEMS_TASKS,       /* object class */
    76     Configuration_RTEMS_API.maximum_tasks
    77                                /* maximum objects of this class */
    78   );
    79 
    80   /*
    81    *  Add all the extensions for this API
    82    */
    83 
    84   _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );
    85 
    86   /*
    87    *  Register the MP Process Packet routine.
    88    */
    89 
    90 #if defined(RTEMS_MULTIPROCESSING)
    91   _MPCI_Register_packet_processor(
    92     MP_PACKET_TASKS,
    93     _RTEMS_tasks_MP_Process_packet
    94   );
    95 #endif
    96 
    97 }
    98 
    99 RTEMS_SYSINIT_ITEM(
    100   _RTEMS_tasks_Manager_initialization,
    101   RTEMS_SYSINIT_CLASSIC_TASKS,
    102   RTEMS_SYSINIT_ORDER_MIDDLE
     23THREAD_INFORMATION_DEFINE_ZERO(
     24  _RTEMS_tasks,
     25  OBJECTS_CLASSIC_API,
     26  OBJECTS_RTEMS_TASKS
    10327);
  • cpukit/rtems/src/timercreate.c

    r0f5b2c09 r21275b58  
    2828#include <rtems/score/todimpl.h>
    2929#include <rtems/score/watchdogimpl.h>
     30#include <rtems/sysinit.h>
    3031
    3132RTEMS_STATIC_ASSERT(
     
    3334  TIMER_CLASS_BIT_TIME_OF_DAY
    3435);
     36
     37Timer_server_Control *volatile _Timer_server;
    3538
    3639void _Timer_Routine_adaptor( Watchdog_Control *the_watchdog )
     
    213216  return RTEMS_SUCCESSFUL;
    214217}
     218
     219static void _Timer_Manager_initialization( void )
     220{
     221  _Objects_Initialize_information( &_Timer_Information );
     222}
     223
     224RTEMS_SYSINIT_ITEM(
     225  _Timer_Manager_initialization,
     226  RTEMS_SYSINIT_CLASSIC_TIMER,
     227  RTEMS_SYSINIT_ORDER_MIDDLE
     228);
Note: See TracChangeset for help on using the changeset viewer.