summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/sapi/include/rtems/extensionimpl.h7
-rw-r--r--cpukit/sapi/src/extensiondelete.c33
2 files changed, 15 insertions, 25 deletions
diff --git a/cpukit/sapi/include/rtems/extensionimpl.h b/cpukit/sapi/include/rtems/extensionimpl.h
index e26731cbcc..64ac600520 100644
--- a/cpukit/sapi/include/rtems/extensionimpl.h
+++ b/cpukit/sapi/include/rtems/extensionimpl.h
@@ -39,13 +39,10 @@ RTEMS_INLINE_ROUTINE void _Extension_Free (
_Objects_Free( &_Extension_Information, &the_extension->Object );
}
-RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get (
- Objects_Id id,
- Objects_Locations *location
-)
+RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get( Objects_Id id )
{
return (Extension_Control *)
- _Objects_Get( &_Extension_Information, id, location );
+ _Objects_Get_no_protection( &_Extension_Information, id );
}
#ifdef __cplusplus
diff --git a/cpukit/sapi/src/extensiondelete.c b/cpukit/sapi/src/extensiondelete.c
index f851ea06c2..af2bd83f18 100644
--- a/cpukit/sapi/src/extensiondelete.c
+++ b/cpukit/sapi/src/extensiondelete.c
@@ -20,35 +20,28 @@
#endif
#include <rtems/extensionimpl.h>
-#include <rtems/score/thread.h>
#include <rtems/score/userextimpl.h>
rtems_status_code rtems_extension_delete(
rtems_id id
)
{
- Extension_Control *the_extension;
- Objects_Locations location;
+ rtems_status_code status;
+ Extension_Control *the_extension;
_Objects_Allocator_lock();
- the_extension = _Extension_Get( id, &location );
- switch ( location ) {
- case OBJECTS_LOCAL:
- _User_extensions_Remove_set( &the_extension->Extension );
- _Objects_Close( &_Extension_Information, &the_extension->Object );
- _Objects_Put( &the_extension->Object );
- _Extension_Free( the_extension );
- _Objects_Allocator_unlock();
- return RTEMS_SUCCESSFUL;
-
-#if defined(RTEMS_MULTIPROCESSING)
- case OBJECTS_REMOTE: /* should never return this */
-#endif
- case OBJECTS_ERROR:
- break;
+
+ the_extension = _Extension_Get( id );
+
+ if ( the_extension != NULL ) {
+ _Objects_Close( &_Extension_Information, &the_extension->Object );
+ _User_extensions_Remove_set( &the_extension->Extension );
+ _Extension_Free( the_extension );
+ status = RTEMS_SUCCESSFUL;
+ } else {
+ status = RTEMS_INVALID_ID;
}
_Objects_Allocator_unlock();
-
- return RTEMS_INVALID_ID;
+ return status;
}