Skip to content

Commit

Permalink
score: Delete object control block ISR lock
Browse files Browse the repository at this point in the history
The Objects_Control::Lock was a software layer violation.  It worked
only for the threads since they are somewhat special.

Update #2273.
  • Loading branch information
sebhub committed Apr 21, 2015
1 parent 1041de1 commit d3802bb
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 181 deletions.
1 change: 0 additions & 1 deletion cpukit/score/Makefile.am
Expand Up @@ -203,7 +203,6 @@ libscore_a_SOURCES += src/objectallocate.c src/objectclose.c \
src/objectgetinfo.c src/objectgetinfoid.c src/objectapimaximumclass.c \
src/objectnamespaceremove.c \
src/objectactivecount.c
libscore_a_SOURCES += src/objectacquire.c

## SCHEDULER_C_FILES
libscore_a_SOURCES += src/log2table.c
Expand Down
3 changes: 0 additions & 3 deletions cpukit/score/include/rtems/score/object.h
Expand Up @@ -23,7 +23,6 @@
#include <rtems/score/basedefs.h>
#include <rtems/score/cpu.h>
#include <rtems/score/chain.h>
#include <rtems/score/isrlock.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -237,8 +236,6 @@ typedef struct {
Objects_Id id;
/** This is the object's name. */
Objects_Name name;
/** This is the object's ISR lock. */
ISR_LOCK_MEMBER( Lock )
} Objects_Control;

#if defined( RTEMS_MULTIPROCESSING )
Expand Down
95 changes: 0 additions & 95 deletions cpukit/score/include/rtems/score/objectimpl.h
Expand Up @@ -590,98 +590,6 @@ Objects_Control *_Objects_Get_no_protection(
Objects_Locations *location
);

/**
* @brief Acquires an object by its identifier.
*
* This function is similar to _Objects_Get_isr_disable(). It disables
* interrupts and acquires the object specific ISR lock for local objects.
* Thread dispatching is not disabled for local objects. For remote objects
* thread dispatching is disabled.
*
* @param[in] information The object information.
* @param[in] id The object identifier.
* @param[in] location The location of the object.
* @param[in] lock_context The lock context for local objects.
*
* @retval object The object corresponding to the identifier.
* @retval NULL No object exists in this domain for this identifier.
*
* @see _Objects_ISR_disable_and_acquire(), _Objects_Release(),
* _Objects_Release_and_ISR_enable(), and
* _Objects_Release_and_thread_dispatch_disable().
*/
Objects_Control *_Objects_Acquire(
const Objects_Information *information,
Objects_Id id,
Objects_Locations *location,
ISR_lock_Context *lock_context
);

/**
* @brief Acquires a local object and disables interrupts.
*
* @param[in] the_object The local object to acquire.
* @param[in] lock_context The lock context.
*/
RTEMS_INLINE_ROUTINE void _Objects_ISR_disable_and_acquire(
Objects_Control *the_object,
ISR_lock_Context *lock_context
)
{
_ISR_lock_ISR_disable_and_acquire( &the_object->Lock, lock_context );
}

/**
* @brief Releases a local object.
*
* @param[in] the_object The local object acquired by _Objects_Acquire().
* @param[in] lock_context The lock context initialized by _Objects_Acquire().
*/
RTEMS_INLINE_ROUTINE void _Objects_Release(
Objects_Control *the_object,
ISR_lock_Context *lock_context
)
{
_ISR_lock_Release( &the_object->Lock, lock_context );
}

/**
* @brief Releases a local object and restores the interrupt level.
*
* @param[in] the_object The local object acquired by _Objects_Acquire().
* @param[in] lock_context The lock context initialized by _Objects_Acquire().
*/
RTEMS_INLINE_ROUTINE void _Objects_Release_and_ISR_enable(
Objects_Control *the_object,
ISR_lock_Context *lock_context
)
{
_ISR_lock_Release_and_ISR_enable( &the_object->Lock, lock_context );
}

/**
* @brief Releases a local object, disables thread dispatching and restores the
* interrupt level.
*
* @param[in] the_object The local object acquired by _Objects_Acquire().
* @param[in] lock_context The lock context initialized by _Objects_Acquire().
*
* @return The current processor.
*/
RTEMS_INLINE_ROUTINE Per_CPU_Control *
_Objects_Release_and_thread_dispatch_disable(
Objects_Control *the_object,
ISR_lock_Context *lock_context
)
{
Per_CPU_Control *cpu_self;

cpu_self = _Thread_Dispatch_disable_critical();
_Objects_Release_and_ISR_enable( the_object, lock_context );

return cpu_self;
}

/**
* Like @ref _Objects_Get, but is used to find "next" open object.
*
Expand Down Expand Up @@ -995,7 +903,6 @@ RTEMS_INLINE_ROUTINE void _Objects_Open(
_Assert( the_object != NULL );

the_object->name = name;
_ISR_lock_Initialize( &the_object->Lock, "Object" );

_Objects_Set_local_object(
information,
Expand All @@ -1020,7 +927,6 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_u32(
{
/* ASSERT: information->is_string == false */
the_object->name.name_u32 = name;
_ISR_lock_Initialize( &the_object->Lock, "Object" );

_Objects_Set_local_object(
information,
Expand All @@ -1047,7 +953,6 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_string(
/* ASSERT: information->is_string */
the_object->name.name_p = name;
#endif
_ISR_lock_Initialize( &the_object->Lock, "Object" );

_Objects_Set_local_object(
information,
Expand Down
1 change: 1 addition & 0 deletions cpukit/score/include/rtems/score/thread.h
Expand Up @@ -26,6 +26,7 @@
#if defined(RTEMS_MULTIPROCESSING)
#include <rtems/score/mppkt.h>
#endif
#include <rtems/score/isrlock.h>
#include <rtems/score/object.h>
#include <rtems/score/percpu.h>
#include <rtems/score/priority.h>
Expand Down
80 changes: 0 additions & 80 deletions cpukit/score/src/objectacquire.c

This file was deleted.

2 changes: 0 additions & 2 deletions cpukit/score/src/objectclose.c
Expand Up @@ -28,6 +28,4 @@ void _Objects_Close(
_Objects_Invalidate_Id( information, the_object );

_Objects_Namespace_remove( information, the_object );

_ISR_lock_Destroy( &the_object->Lock );
}

0 comments on commit d3802bb

Please sign in to comment.