summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-12-14 15:12:39 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-02-03 10:00:53 +0100
commitaf12278f9b33d7d8dca96d3873472ef2382f3c8e (patch)
treeebf8362e653d047eab45b59f0ebd53a21e8a5852
parentOptional Classic Region initialization (diff)
downloadrtems-af12278f9b33d7d8dca96d3873472ef2382f3c8e.tar.bz2
Optional Classic Dual-Ported Memory initialization
Update #2408.
-rw-r--r--cpukit/rtems/Makefile.am1
-rw-r--r--cpukit/rtems/include/rtems/rtems/dpmemimpl.h19
-rw-r--r--cpukit/rtems/src/dpmem.c13
-rw-r--r--cpukit/rtems/src/dpmemdata.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, 48 deletions
diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am
index c4bc9e8c60..387710c69c 100644
--- a/cpukit/rtems/Makefile.am
+++ b/cpukit/rtems/Makefile.am
@@ -237,7 +237,6 @@ librtems_a_SOURCES += src/dpmemdelete.c
librtems_a_SOURCES += src/dpmemexternal2internal.c
librtems_a_SOURCES += src/dpmemident.c
librtems_a_SOURCES += src/dpmeminternal2external.c
-librtems_a_SOURCES += src/dpmemdata.c
## WORKSPACE_FILES
librtems_a_SOURCES += src/workspace.c
diff --git a/cpukit/rtems/include/rtems/rtems/dpmemimpl.h b/cpukit/rtems/include/rtems/rtems/dpmemimpl.h
index 3e0c231fad..213856dcdf 100644
--- a/cpukit/rtems/include/rtems/rtems/dpmemimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/dpmemimpl.h
@@ -33,27 +33,10 @@ 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_DPMEM_EXTERN
-#define RTEMS_DPMEM_EXTERN extern
-#endif
-
-/**
* @brief Define the internal Dual Ported Memory information
* The following define the internal Dual Ported Memory information.
*/
-RTEMS_DPMEM_EXTERN Objects_Information _Dual_ported_memory_Information;
-
-/**
- * @brief Dual Ported Memory Manager Initialization
- *
- * This routine performs the initialization necessary for this manager.
- */
-void _Dual_ported_memory_Manager_initialization(void);
+extern Objects_Information _Dual_ported_memory_Information;
/**
* @brief Allocates a port control block from the inactive chain
diff --git a/cpukit/rtems/src/dpmem.c b/cpukit/rtems/src/dpmem.c
index 9af807e951..aca71a3a1f 100644
--- a/cpukit/rtems/src/dpmem.c
+++ b/cpukit/rtems/src/dpmem.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/address.h>
#include <rtems/rtems/dpmemimpl.h>
-#include <rtems/score/thread.h>
-void _Dual_ported_memory_Manager_initialization(void)
+Objects_Information _Dual_ported_memory_Information;
+
+static void _Dual_ported_memory_Manager_initialization(void)
{
_Objects_Initialize_information(
&_Dual_ported_memory_Information, /* object information table */
@@ -45,3 +46,9 @@ void _Dual_ported_memory_Manager_initialization(void)
#endif
);
}
+
+RTEMS_SYSINIT_ITEM(
+ _Dual_ported_memory_Manager_initialization,
+ RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/dpmemdata.c b/cpukit/rtems/src/dpmemdata.c
deleted file mode 100644
index e315ef8cef..0000000000
--- a/cpukit/rtems/src/dpmemdata.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * @file
- *
- * @brief Define the internal Dual Ported Memory information
- * @ingroup ClassicDPMEM Dual Ported Memory
- */
-
-/*
- * 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 semaphore data */
-#define RTEMS_DPMEM_EXTERN
-
-#include <rtems/rtems/dpmemimpl.h>
diff --git a/cpukit/sapi/src/rtemsapi.c b/cpukit/sapi/src/rtemsapi.c
index 8699c15e0d..b6ee1d8173 100644
--- a/cpukit/sapi/src/rtemsapi.c
+++ b/cpukit/sapi/src/rtemsapi.c
@@ -28,12 +28,10 @@
#include <rtems/rtems/intr.h>
#include <rtems/rtems/barrierimpl.h>
#include <rtems/rtems/clock.h>
-#include <rtems/rtems/dpmemimpl.h>
#include <rtems/rtems/ratemonimpl.h>
void _RTEMS_API_Initialize(void)
{
- _Dual_ported_memory_Manager_initialization();
_Rate_monotonic_Manager_initialization();
_Barrier_Manager_initialization();
}
diff --git a/cpukit/score/include/rtems/sysinit.h b/cpukit/score/include/rtems/sysinit.h
index b0a6e3263b..60687ecb7c 100644
--- a/cpukit/score/include/rtems/sysinit.h
+++ b/cpukit/score/include/rtems/sysinit.h
@@ -39,6 +39,7 @@ extern "C" {
#define RTEMS_SYSINIT_CLASSIC_SEMAPHORE 000345
#define RTEMS_SYSINIT_CLASSIC_PARTITION 000346
#define RTEMS_SYSINIT_CLASSIC_REGION 000347
+#define RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY 000348
#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 f1db15298f..914485e424 100644
--- a/testsuites/sptests/spsysinit01/init.c
+++ b/testsuites/sptests/spsysinit01/init.c
@@ -25,6 +25,7 @@
#include <rtems/test.h>
#include <rtems/extensionimpl.h>
+#include <rtems/rtems/dpmemimpl.h>
#include <rtems/rtems/messageimpl.h>
#include <rtems/rtems/partimpl.h>
#include <rtems/rtems/regionimpl.h>
@@ -65,6 +66,8 @@ typedef enum {
CLASSIC_PARTITION_POST,
CLASSIC_REGION_PRE,
CLASSIC_REGION_POST,
+ CLASSIC_DUAL_PORTED_MEMORY_PRE,
+ CLASSIC_DUAL_PORTED_MEMORY_POST,
IDLE_THREADS_PRE,
IDLE_THREADS_POST,
BSP_LIBC_PRE,
@@ -264,6 +267,18 @@ LAST(RTEMS_SYSINIT_CLASSIC_REGION)
next_step(CLASSIC_REGION_POST);
}
+FIRST(RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY)
+{
+ assert(_Dual_ported_memory_Information.maximum == 0);
+ next_step(CLASSIC_DUAL_PORTED_MEMORY_PRE);
+}
+
+LAST(RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY)
+{
+ assert(_Dual_ported_memory_Information.maximum != 0);
+ next_step(CLASSIC_DUAL_PORTED_MEMORY_POST);
+}
+
FIRST(RTEMS_SYSINIT_IDLE_THREADS)
{
assert(_System_state_Is_before_initialization(_System_state_Get()));
@@ -353,6 +368,8 @@ static void Init(rtems_task_argument arg)
#define CONFIGURE_MAXIMUM_PARTITIONS 1
+#define CONFIGURE_MAXIMUM_PORTS 1
+
#define CONFIGURE_MAXIMUM_REGIONS 1
#define CONFIGURE_MAXIMUM_SEMAPHORES 1