diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-12-14 15:05:47 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-02-03 10:00:53 +0100 |
commit | cbaac1f7f4b3d78673abfde9bd6ed7e43dddf12c (patch) | |
tree | 3aaafa8bebc23c6ae79f43a1d01fa927b2d66f8f /cpukit/rtems | |
parent | Optional Classic Message Queue initialization (diff) | |
download | rtems-cbaac1f7f4b3d78673abfde9bd6ed7e43dddf12c.tar.bz2 |
Optional Classic Semaphore initialization
Update #2408.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r-- | cpukit/rtems/Makefile.am | 1 | ||||
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/semimpl.h | 24 | ||||
-rw-r--r-- | cpukit/rtems/src/sem.c | 15 | ||||
-rw-r--r-- | cpukit/rtems/src/semdata.c | 24 |
4 files changed, 10 insertions, 54 deletions
diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am index 2fd8ecb1a2..d28e1bdeaf 100644 --- a/cpukit/rtems/Makefile.am +++ b/cpukit/rtems/Makefile.am @@ -194,7 +194,6 @@ librtems_a_SOURCES += src/semobtain.c librtems_a_SOURCES += src/semrelease.c librtems_a_SOURCES += src/semflush.c librtems_a_SOURCES += src/semtranslatereturncode.c -librtems_a_SOURCES += src/semdata.c librtems_a_SOURCES += src/semsetpriority.c ## EVENT_C_FILES diff --git a/cpukit/rtems/include/rtems/rtems/semimpl.h b/cpukit/rtems/include/rtems/rtems/semimpl.h index 8c93e93554..68eac6f2e7 100644 --- a/cpukit/rtems/include/rtems/rtems/semimpl.h +++ b/cpukit/rtems/include/rtems/rtems/semimpl.h @@ -27,25 +27,10 @@ extern "C" { #endif /** - * @brief Instantiate Semaphore Data - * - * Semaphore Manager -- Data Instantiation - * - * 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_SEM_EXTERN -#define RTEMS_SEM_EXTERN extern -#endif - -/** * The following defines the information control block used to manage * this class of objects. */ -RTEMS_SEM_EXTERN Objects_Information _Semaphore_Information; +extern Objects_Information _Semaphore_Information; extern const rtems_status_code _Semaphore_Translate_core_mutex_return_code_[]; @@ -54,13 +39,6 @@ extern const rtems_status_code _Semaphore_Translate_core_semaphore_return_code_[]; /** - * @brief Semaphore Manager Initialization - * - * This routine performs the initialization necessary for this manager. - */ -void _Semaphore_Manager_initialization(void); - -/** * @brief Semaphore Translate Core Mutex Return Code * * This function returns a RTEMS status code based on the mutex diff --git a/cpukit/rtems/src/sem.c b/cpukit/rtems/src/sem.c index 7612c82e8b..13615eb8bd 100644 --- a/cpukit/rtems/src/sem.c +++ b/cpukit/rtems/src/sem.c @@ -20,19 +20,16 @@ #include <rtems/system.h> #include <rtems/config.h> +#include <rtems/sysinit.h> #include <rtems/rtems/status.h> #include <rtems/rtems/support.h> #include <rtems/rtems/attrimpl.h> -#include <rtems/score/isr.h> #include <rtems/rtems/options.h> #include <rtems/rtems/semimpl.h> -#include <rtems/score/coremuteximpl.h> -#include <rtems/score/coresemimpl.h> -#include <rtems/score/thread.h> -#include <rtems/score/interr.h> +Objects_Information _Semaphore_Information; -void _Semaphore_Manager_initialization(void) +static void _Semaphore_Manager_initialization(void) { _Objects_Initialize_information( &_Semaphore_Information, /* object information table */ @@ -62,3 +59,9 @@ void _Semaphore_Manager_initialization(void) #endif } + +RTEMS_SYSINIT_ITEM( + _Semaphore_Manager_initialization, + RTEMS_SYSINIT_CLASSIC_SEMAPHORE, + RTEMS_SYSINIT_ORDER_MIDDLE +); diff --git a/cpukit/rtems/src/semdata.c b/cpukit/rtems/src/semdata.c deleted file mode 100644 index bac5c815b9..0000000000 --- a/cpukit/rtems/src/semdata.c +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @file - * - * @brief Instantiate Semaphore Data - * @ingroup ClassicSem Semaphores - */ - -/* - * 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_SEM_EXTERN - -#include <rtems/rtems/semimpl.h> |