summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-17 15:11:16 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 07:49:40 +0200
commitee710ef483b76ebbd54cdc8fac05a228d9ef30ff (patch)
tree981c336c13f931dc33b8e24429f7e247ca603427
parentscore: Delete unused _Thread_Get() (diff)
downloadrtems-ee710ef483b76ebbd54cdc8fac05a228d9ef30ff.tar.bz2
score: Delete unused _Objects_Get()
Update #2555.
-rw-r--r--cpukit/score/Makefile.am2
-rw-r--r--cpukit/score/include/rtems/score/object.h2
-rw-r--r--cpukit/score/include/rtems/score/objectimpl.h116
-rw-r--r--cpukit/score/src/objectget.c80
4 files changed, 18 insertions, 182 deletions
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index ac2f0b5cce..0fe78dad00 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -210,7 +210,7 @@ libscore_a_SOURCES += src/heap.c src/heapallocate.c src/heapextend.c \
## OBJECT_C_FILES
libscore_a_SOURCES += src/objectallocate.c src/objectclose.c \
- src/objectextendinformation.c src/objectfree.c src/objectget.c \
+ src/objectextendinformation.c src/objectfree.c \
src/objectgetisr.c src/objectgetnext.c src/objectinitializeinformation.c \
src/objectnametoid.c src/objectnametoidstring.c \
src/objectshrinkinformation.c src/objectgetnoprotection.c \
diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h
index c2acb2dbaa..6789c61fea 100644
--- a/cpukit/score/include/rtems/score/object.h
+++ b/cpukit/score/include/rtems/score/object.h
@@ -289,7 +289,7 @@ typedef struct {
/**
* The following defines the constant which may be used
- * with _Objects_Get to manipulate the calling task.
+ * to manipulate the calling task.
*/
#define OBJECTS_ID_OF_SELF ((Objects_Id) 0)
diff --git a/cpukit/score/include/rtems/score/objectimpl.h b/cpukit/score/include/rtems/score/objectimpl.h
index fe087719b7..4049bdcfe0 100644
--- a/cpukit/score/include/rtems/score/objectimpl.h
+++ b/cpukit/score/include/rtems/score/objectimpl.h
@@ -110,7 +110,7 @@ typedef enum {
/**
* This enumerated type lists the locations which may be returned
- * by _Objects_Get. These codes indicate the success of locating
+ * by _Objects_Get_isr_disable. These codes indicate the success of locating
* an object with the specified ID.
*/
typedef enum {
@@ -405,45 +405,33 @@ Objects_Control *_Objects_Allocate( Objects_Information *information );
* @code
* rtems_status_code some_delete( rtems_id id )
* {
- * rtems_status_code sc;
* Some_Control *some;
- * Objects_Locations location;
*
* // The object allocator mutex protects the executing thread from
* // asynchronous thread restart and deletion.
* _Objects_Allocator_lock();
*
- * // This will disable thread dispatching, so this starts a thread dispatch
- * // critical section.
+ * // Get the object under protection of the object allocator mutex.
* some = (Semaphore_Control *)
- * _Objects_Get( &_Some_Information, id, &location );
- *
- * switch ( location ) {
- * case OBJECTS_LOCAL:
- * // After the object close an object get with this identifier will
- * // fail.
- * _Objects_Close( &_Some_Information, &some->Object );
+ * _Objects_Get_no_protection( id, &_Some_Information );
*
- * _Some_Delete( some );
+ * if ( some == NULL ) {
+ * _Objects_Allocator_unlock();
+ * return RTEMS_INVALID_ID;
+ * }
*
- * // This enables thread dispatching, so the thread dispatch critical
- * // section ends here.
- * _Objects_Put( &some->Object );
+ * // After the object close an object get with this identifier will
+ * // fail.
+ * _Objects_Close( &_Some_Information, &some->Object );
*
- * // Thread dispatching is enabled. The object free is only protected
- * // by the object allocator mutex.
- * _Objects_Free( &_Some_Information, &some->Object );
+ * _Some_Delete( some );
*
- * sc = RTEMS_SUCCESSFUL;
- * break;
- * default:
- * sc = RTEMS_INVALID_ID;
- * break;
- * }
+ * // Thread dispatching is enabled. The object free is only protected
+ * // by the object allocator mutex.
+ * _Objects_Free( &_Some_Information, &some->Object );
*
* _Objects_Allocator_unlock();
- *
- * return sc;
+ * return RTEMS_SUCCESSFUL;
* }
* @endcode
*/
@@ -569,49 +557,12 @@ Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
* @param[in] information points to an object class information block.
* @param[in] id is the Id of the object whose name we are locating.
* @param[in] location will contain an indication of success or failure.
- *
- * @retval This method returns one of the values from the
- * @ref Objects_Name_or_id_lookup_errors enumeration to indicate
- * successful or failure. On success @a id will contain the Id of
- * the requested object.
- *
- * @note _Objects_Get returns with dispatching disabled for
- * local and remote objects. _Objects_Get_isr_disable returns with
- * dispatching disabled for remote objects and interrupts for local
- * objects.
- */
-Objects_Control *_Objects_Get (
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location
-);
-
-/**
- * @brief Maps object ids to object control blocks.
- *
- * This function maps object ids to object control blocks.
- * If id corresponds to a local object, then it returns
- * the_object control pointer which maps to id and location
- * is set to OBJECTS_LOCAL. If the object class supports global
- * objects and the object id is global and resides on a remote
- * node, then location is set to OBJECTS_REMOTE, and the_object
- * is undefined. Otherwise, location is set to OBJECTS_ERROR
- * and the_object is undefined.
- *
- * @param[in] information points to an object class information block.
- * @param[in] id is the Id of the object whose name we are locating.
- * @param[in] location will contain an indication of success or failure.
* @param[in] lock_context is the previous interrupt state being turned.
*
* @retval This method returns one of the values from the
* @ref Objects_Name_or_id_lookup_errors enumeration to indicate
* successful or failure. On success @a name will contain the name of
* the requested object.
- *
- * @note _Objects_Get returns with dispatching disabled for
- * local and remote objects. _Objects_Get_isr_disable returns with
- * dispatchng disabled for remote objects and interrupts for local
- * objects.
*/
Objects_Control *_Objects_Get_isr_disable(
Objects_Information *information,
@@ -667,11 +618,6 @@ Objects_Control *_Objects_Get_local(
* @ref Objects_Name_or_id_lookup_errors enumeration to indicate
* successful or failure. On success @a id will contain the Id of
* the requested object.
- *
- * @note _Objects_Get returns with dispatching disabled for
- * local and remote objects. _Objects_Get_isr_disable returns with
- * dispatching disabled for remote objects and interrupts for local
- * objects.
*/
Objects_Control *_Objects_Get_no_protection(
Objects_Id id,
@@ -679,8 +625,7 @@ Objects_Control *_Objects_Get_no_protection(
);
/**
- * Like @ref _Objects_Get, but is used to find "next" open
- * object.
+ * Gets the next open object after the specified object identifier.
*
* Locks the object allocator mutex in case a next object exists.
*
@@ -1060,35 +1005,6 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_string(
}
/**
- * @brief Puts back an object obtained with _Objects_Get().
- *
- * This function decrements the thread dispatch disable level. The
- * _Thread_Dispatch() is called if the level reaches zero.
- */
-RTEMS_INLINE_ROUTINE void _Objects_Put(
- Objects_Control *the_object
-)
-{
- (void) the_object;
- _Thread_Enable_dispatch();
-}
-
-/**
- * @brief Puts back an object obtained with _Objects_Get().
- *
- * This function decrements the thread dispatch disable level. The
- * _Thread_Dispatch() is not called if the level reaches zero, thus a thread
- * dispatch will not take place immediately on the current processor.
- */
-RTEMS_INLINE_ROUTINE void _Objects_Put_without_thread_dispatch(
- Objects_Control *the_object
-)
-{
- (void) the_object;
- _Thread_Unnest_dispatch();
-}
-
-/**
* @brief Locks the object allocator mutex.
*
* While holding the allocator mutex the executing thread is protected from
diff --git a/cpukit/score/src/objectget.c b/cpukit/score/src/objectget.c
deleted file mode 100644
index 276c96094c..0000000000
--- a/cpukit/score/src/objectget.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * @file
- *
- * @brief Get Object
- * @ingroup Score
- */
-
-/*
- * COPYRIGHT (c) 1989-1999.
- * 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
-
-#include <rtems/score/objectimpl.h>
-
-Objects_Control *_Objects_Get(
- Objects_Information *information,
- Objects_Id id,
- Objects_Locations *location
-)
-{
- Objects_Control *the_object;
- uint32_t index;
-
- /*
- * Extract the index portion of an Id in a way that produces a valid
- * index for objects within this class and an invalid value for objects
- * outside this class.
- *
- * If the Id matches the api, class, and node but index portion is 0,
- * then the subtraction will underflow and the addition of 1 will
- * result in a 0 index. The zeroth element in the local_table is
- * always NULL.
- *
- * If the Id is valid but the object has not been created yet, then
- * the local_table entry will be NULL.
- */
- index = id - information->minimum_id + 1;
-
- /*
- * If the index is less than maximum, then it is OK to use it to
- * index into the local_table array.
- */
- if ( index <= information->maximum ) {
- _Thread_Disable_dispatch();
- if ( (the_object = information->local_table[ index ]) != NULL ) {
- *location = OBJECTS_LOCAL;
- return the_object;
- }
-
- /*
- * Valid Id for this API, Class and Node but the object has not
- * been allocated yet.
- */
- _Thread_Enable_dispatch();
- *location = OBJECTS_ERROR;
- return NULL;
- }
-
- /*
- * Object Id is not within this API and Class on this node. So
- * it may be global in a multiprocessing system. But it is clearly
- * invalid on a single processor system.
- */
-
-#if defined(RTEMS_MULTIPROCESSING)
- *location = _Objects_MP_Is_remote( information, id );
-#else
- *location = OBJECTS_ERROR;
-#endif
-
- return NULL;
-}