summaryrefslogtreecommitdiffstats
path: root/cpukit/score/inline
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-07-01 22:30:12 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-07-01 22:30:12 +0000
commitef9505a92f6c9c962dc2649f49002311466e009e (patch)
tree5a869b6101918ff8b37f19ca2b36f0b835d69d58 /cpukit/score/inline
parent2002-07-01 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-ef9505a92f6c9c962dc2649f49002311466e009e.tar.bz2
2002-07-01 Joel Sherrill <joel@OARcorp.com>
* Mega patch merge to change the format of the object IDs to loosen the dependency between the SCORE and the various APIs. There was considerable work to simplify the object name management and it appears that the name_table field is no longer needed. This patch also includes the addition of the internal mutex which is currently only used to protect some types of allocation and deallocation. This significantly can reduce context switch latency under certain circumstances. In particular, some heap/region operations were O(n) and had dispatching disabled. This should help enormously. With this merge, the patch is not as clean as it should be. In particular, the documentation has not been modified to reflect the new object ID layout, the IDs in the test screens are not updated, and _Objects_Get_information needs to be a real routine not inlined. As part of this patch a lot of MP code for thread/proxy blocking was made conditional and cleaned up. * include/Makefile.am, include/rtems/score/coremsg.h, include/rtems/score/coremutex.h, include/rtems/score/coresem.h, include/rtems/score/object.h, include/rtems/score/threadq.h, inline/rtems/score/object.inl, inline/rtems/score/thread.inl, macros/rtems/score/object.inl, src/Makefile.am, src/coremsg.c, src/coremutex.c, src/coresem.c, src/mpci.c, src/objectcomparenameraw.c, src/objectextendinformation.c, src/objectinitializeinformation.c, src/objectnametoid.c, src/thread.c, src/threadclose.c, src/threadget.c, src/threadq.c, src/threadqextractwithproxy.c: Modified as part of above. * include/rtems/score/apimutex.h, src/objectgetnoprotection.c: New files.
Diffstat (limited to 'cpukit/score/inline')
-rw-r--r--cpukit/score/inline/rtems/score/object.inl48
-rw-r--r--cpukit/score/inline/rtems/score/thread.inl16
2 files changed, 46 insertions, 18 deletions
diff --git a/cpukit/score/inline/rtems/score/object.inl b/cpukit/score/inline/rtems/score/object.inl
index ae36d1c819..c09c09bc00 100644
--- a/cpukit/score/inline/rtems/score/object.inl
+++ b/cpukit/score/inline/rtems/score/object.inl
@@ -3,7 +3,7 @@
* This include file contains the static inline implementation of all
* of the inlined routines in the Object Handler.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2002.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -27,14 +27,32 @@
*/
RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id(
- Objects_Classes the_class,
+ Objects_APIs the_api,
+ unsigned32 the_class,
unsigned32 node,
unsigned32 index
)
{
- return (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
- (( (Objects_Id) node ) << OBJECTS_NODE_START_BIT) |
- (( (Objects_Id) index ) << OBJECTS_INDEX_START_BIT);
+ return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
+ (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
+ (( (Objects_Id) node ) << OBJECTS_NODE_START_BIT) |
+ (( (Objects_Id) index ) << OBJECTS_INDEX_START_BIT);
+}
+
+/*PAGE
+ *
+ * _Objects_Get_API
+ *
+ * DESCRIPTION:
+ *
+ * This function returns the API portion of the ID.
+ */
+
+RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API(
+ Objects_Id id
+)
+{
+ return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS);
}
/*PAGE
@@ -46,15 +64,14 @@ RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id(
* This function returns the class portion of the ID.
*/
-RTEMS_INLINE_ROUTINE Objects_Classes _Objects_Get_class(
+RTEMS_INLINE_ROUTINE unsigned32 _Objects_Get_class(
Objects_Id id
)
{
- return (Objects_Classes)
+ return (unsigned32)
((id >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS);
}
-
/*PAGE
*
* _Objects_Get_node
@@ -97,10 +114,11 @@ RTEMS_INLINE_ROUTINE unsigned32 _Objects_Get_index(
*/
RTEMS_INLINE_ROUTINE boolean _Objects_Is_class_valid(
- Objects_Classes the_class
+ unsigned32 the_class
)
{
- return the_class && the_class <= OBJECTS_CLASSES_LAST;
+ /* XXX how do we determine this now? */
+ return TRUE; /* the_class && the_class <= OBJECTS_CLASSES_LAST; */
}
/*PAGE
@@ -210,14 +228,17 @@ RTEMS_INLINE_ROUTINE Objects_Information *_Objects_Get_information(
Objects_Id id
)
{
- Objects_Classes the_class;
+ Objects_APIs the_api;
+ unsigned32 the_class;
+
the_class = _Objects_Get_class( id );
if ( !_Objects_Is_class_valid( the_class ) )
return NULL;
- return _Objects_Information_table[ the_class ];
+ the_api = _Objects_Get_API( id );
+ return _Objects_Information_table[ the_api ][ the_class ];
}
/*PAGE
@@ -245,7 +266,8 @@ RTEMS_INLINE_ROUTINE void _Objects_Open(
/* _Objects_Copy_name_string( name, the_object->name ); */
the_object->name = name;
else
- _Objects_Copy_name_raw( name, the_object->name, information->name_length );
+ /* _Objects_Copy_name_raw( name, the_object->name, information->name_length ); */
+ the_object->name = name;
}
/*PAGE
diff --git a/cpukit/score/inline/rtems/score/thread.inl b/cpukit/score/inline/rtems/score/thread.inl
index 560006c9e9..72d7a5dac5 100644
--- a/cpukit/score/inline/rtems/score/thread.inl
+++ b/cpukit/score/inline/rtems/score/thread.inl
@@ -309,7 +309,8 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Get (
Objects_Locations *location
)
{
- Objects_Classes the_class;
+ unsigned32 the_api;
+ unsigned32 the_class;
Objects_Information *information;
Thread_Control *tp = (Thread_Control *) 0;
@@ -320,16 +321,21 @@ RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Get (
goto done;
}
+ the_api = _Objects_Get_API( id );
+ if ( the_api && the_api > OBJECTS_APIS_LAST ) {
+ *location = OBJECTS_ERROR;
+ goto done;
+ }
+
the_class = _Objects_Get_class( id );
-
- if ( the_class > OBJECTS_CLASSES_LAST ) {
+ if ( the_class != 1 ) { /* threads are always first class :) */
*location = OBJECTS_ERROR;
goto done;
}
- information = _Objects_Information_table[ the_class ];
+ information = _Objects_Information_table[ the_api ][ the_class ];
- if ( !information || !information->is_thread ) {
+ if ( !information ) {
*location = OBJECTS_ERROR;
goto done;
}