summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-12-14 15:15:22 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-02-03 10:00:53 +0100
commitb377e3f6b70b5a5a09ac1dd77a450e4e5812cc42 (patch)
treed486652a680b9f6ed33dbc8fca44de8cd14dfea0
parentOptional Classic Dual-Ported Memory initialization (diff)
downloadrtems-b377e3f6b70b5a5a09ac1dd77a450e4e5812cc42.tar.bz2
Optional Classic Rate Monotonic initialization
Update #2408.
-rw-r--r--cpukit/rtems/Makefile.am1
-rw-r--r--cpukit/rtems/include/rtems/rtems/ratemonimpl.h21
-rw-r--r--cpukit/rtems/src/ratemon.c13
-rw-r--r--cpukit/rtems/src/ratemondata.c24
-rw-r--r--cpukit/sapi/src/rtemsapi.c2
-rw-r--r--cpukit/score/include/rtems/sysinit.h1
-rw-r--r--testsuites/sptests/spsysinit01/init.c17
7 files changed, 29 insertions, 50 deletions
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
@@ -35,31 +35,12 @@ 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 <rtems/system.h>
#include <rtems/config.h>
+#include <rtems/sysinit.h>
#include <rtems/rtems/status.h>
#include <rtems/rtems/support.h>
-#include <rtems/score/isr.h>
#include <rtems/rtems/ratemonimpl.h>
-#include <rtems/score/thread.h>
-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 <rtems/rtems/ratemonimpl.h>
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 <rtems/rtems/intr.h>
#include <rtems/rtems/barrierimpl.h>
#include <rtems/rtems/clock.h>
-#include <rtems/rtems/ratemonimpl.h>
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 <rtems/rtems/dpmemimpl.h>
#include <rtems/rtems/messageimpl.h>
#include <rtems/rtems/partimpl.h>
+#include <rtems/rtems/ratemonimpl.h>
#include <rtems/rtems/regionimpl.h>
#include <rtems/rtems/semimpl.h>
#include <rtems/rtems/tasksimpl.h>
@@ -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