From b377e3f6b70b5a5a09ac1dd77a450e4e5812cc42 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 14 Dec 2015 15:15:22 +0100 Subject: Optional Classic Rate Monotonic initialization Update #2408. --- cpukit/rtems/Makefile.am | 1 - cpukit/rtems/include/rtems/rtems/ratemonimpl.h | 21 +-------------------- cpukit/rtems/src/ratemon.c | 13 ++++++++++--- cpukit/rtems/src/ratemondata.c | 24 ------------------------ cpukit/sapi/src/rtemsapi.c | 2 -- cpukit/score/include/rtems/sysinit.h | 1 + testsuites/sptests/spsysinit01/init.c | 17 +++++++++++++++++ 7 files changed, 29 insertions(+), 50 deletions(-) delete mode 100644 cpukit/rtems/src/ratemondata.c diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am index 387710c69c..7cf28b93a1 100644 --- a/cpukit/rtems/Makefile.am +++ b/cpukit/rtems/Makefile.am @@ -128,7 +128,6 @@ librtems_a_SOURCES += src/ratemonreportstatistics.c librtems_a_SOURCES += src/ratemonident.c librtems_a_SOURCES += src/ratemonperiod.c librtems_a_SOURCES += src/ratemontimeout.c -librtems_a_SOURCES += src/ratemondata.c ## INTR_C_FILES librtems_a_SOURCES += src/intrbody.c diff --git a/cpukit/rtems/include/rtems/rtems/ratemonimpl.h b/cpukit/rtems/include/rtems/rtems/ratemonimpl.h index b3aa1cf303..90724a4254 100644 --- a/cpukit/rtems/include/rtems/rtems/ratemonimpl.h +++ b/cpukit/rtems/include/rtems/rtems/ratemonimpl.h @@ -34,32 +34,13 @@ extern "C" { * @{ */ -/** - * This constant is defined to extern most of the time when using - * this header file. However by defining it to nothing, the data - * declared in this header file can be instantiated. This is done - * in a single per manager file. - */ -#ifndef RTEMS_RATEMON_EXTERN -#define RTEMS_RATEMON_EXTERN extern -#endif - /** * @brief Rate Monotonic Period Class Management Structure * * This instance of Objects_Information is used to manage the * set of rate monotonic period instances. */ -RTEMS_RATEMON_EXTERN Objects_Information _Rate_monotonic_Information; - -/** - * @brief Rate Monotonic Manager Initialization - * - * This routine performs the initialization necessary for this manager. - * - * @note The Rate Monotonic Manager is built on top of the Watchdog Handler - */ -void _Rate_monotonic_Manager_initialization(void); +extern Objects_Information _Rate_monotonic_Information; /** * @brief Allocates a period control block from diff --git a/cpukit/rtems/src/ratemon.c b/cpukit/rtems/src/ratemon.c index ad5083f75f..b0d248f18a 100644 --- a/cpukit/rtems/src/ratemon.c +++ b/cpukit/rtems/src/ratemon.c @@ -20,13 +20,14 @@ #include #include +#include #include #include -#include #include -#include -void _Rate_monotonic_Manager_initialization(void) +Objects_Information _Rate_monotonic_Information; + +static void _Rate_monotonic_Manager_initialization(void) { _Objects_Initialize_information( &_Rate_monotonic_Information, /* object information table */ @@ -44,3 +45,9 @@ void _Rate_monotonic_Manager_initialization(void) #endif ); } + +RTEMS_SYSINIT_ITEM( + _Rate_monotonic_Manager_initialization, + RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC, + RTEMS_SYSINIT_ORDER_MIDDLE +); diff --git a/cpukit/rtems/src/ratemondata.c b/cpukit/rtems/src/ratemondata.c deleted file mode 100644 index cb4c9ca3b7..0000000000 --- a/cpukit/rtems/src/ratemondata.c +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @file - * - * @brief Instantiate RTEMS Period Data - * @ingroup ClassicRateMon - */ - -/* - * COPYRIGHT (c) 1989-2007. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -/* instantiate RTEMS period data */ -#define RTEMS_RATEMON_EXTERN - -#include diff --git a/cpukit/sapi/src/rtemsapi.c b/cpukit/sapi/src/rtemsapi.c index b6ee1d8173..71f392bb04 100644 --- a/cpukit/sapi/src/rtemsapi.c +++ b/cpukit/sapi/src/rtemsapi.c @@ -28,10 +28,8 @@ #include #include #include -#include void _RTEMS_API_Initialize(void) { - _Rate_monotonic_Manager_initialization(); _Barrier_Manager_initialization(); } diff --git a/cpukit/score/include/rtems/sysinit.h b/cpukit/score/include/rtems/sysinit.h index 60687ecb7c..35806407a1 100644 --- a/cpukit/score/include/rtems/sysinit.h +++ b/cpukit/score/include/rtems/sysinit.h @@ -40,6 +40,7 @@ extern "C" { #define RTEMS_SYSINIT_CLASSIC_PARTITION 000346 #define RTEMS_SYSINIT_CLASSIC_REGION 000347 #define RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY 000348 +#define RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC 000349 #define RTEMS_SYSINIT_IDLE_THREADS 000380 #define RTEMS_SYSINIT_BSP_LIBC 000400 #define RTEMS_SYSINIT_BEFORE_DRIVERS 000500 diff --git a/testsuites/sptests/spsysinit01/init.c b/testsuites/sptests/spsysinit01/init.c index 914485e424..22786bd081 100644 --- a/testsuites/sptests/spsysinit01/init.c +++ b/testsuites/sptests/spsysinit01/init.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -68,6 +69,8 @@ typedef enum { CLASSIC_REGION_POST, CLASSIC_DUAL_PORTED_MEMORY_PRE, CLASSIC_DUAL_PORTED_MEMORY_POST, + CLASSIC_RATE_MONOTONIC_PRE, + CLASSIC_RATE_MONOTONIC_POST, IDLE_THREADS_PRE, IDLE_THREADS_POST, BSP_LIBC_PRE, @@ -279,6 +282,18 @@ LAST(RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY) next_step(CLASSIC_DUAL_PORTED_MEMORY_POST); } +FIRST(RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC) +{ + assert(_Rate_monotonic_Information.maximum == 0); + next_step(CLASSIC_RATE_MONOTONIC_PRE); +} + +LAST(RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC) +{ + assert(_Rate_monotonic_Information.maximum != 0); + next_step(CLASSIC_RATE_MONOTONIC_POST); +} + FIRST(RTEMS_SYSINIT_IDLE_THREADS) { assert(_System_state_Is_before_initialization(_System_state_Get())); @@ -368,6 +383,8 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_MAXIMUM_PARTITIONS 1 +#define CONFIGURE_MAXIMUM_PERIODS 1 + #define CONFIGURE_MAXIMUM_PORTS 1 #define CONFIGURE_MAXIMUM_REGIONS 1 -- cgit v1.2.3