summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-20 08:45:41 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-21 08:25:31 +0200
commit4db0ae8e07870d4ca23dc1b9f8097e3494fe82a2 (patch)
treee7ba3533960b935b67b152198bba713b1c4ebed2 /cpukit/score/include
parentscore: Add _ISR_lock_ISR_disable/enable() (diff)
downloadrtems-4db0ae8e07870d4ca23dc1b9f8097e3494fe82a2.tar.bz2
score: _Objects_Get_isr_disable()
Use ISR_lock_Context instead of ISR_Level to allow use of ISR locks for low-level locking. Update #2273.
Diffstat (limited to 'cpukit/score/include')
-rw-r--r--cpukit/score/include/rtems/score/coremuteximpl.h44
-rw-r--r--cpukit/score/include/rtems/score/coresemimpl.h10
-rw-r--r--cpukit/score/include/rtems/score/objectimpl.h6
3 files changed, 30 insertions, 30 deletions
diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h
index 63a4dba3f0..e1478dd44a 100644
--- a/cpukit/score/include/rtems/score/coremuteximpl.h
+++ b/cpukit/score/include/rtems/score/coremuteximpl.h
@@ -129,7 +129,7 @@ CORE_mutex_Status _CORE_mutex_Initialize(
*
* @param[in,out] executing The currently executing thread.
* @param[in,out] the_mutex is the mutex to attempt to lock
- * @param[in] level is the interrupt level
+ * @param[in] lock_context is the interrupt level
*
* @retval This routine returns 0 if "trylock" can resolve whether or not
* the mutex is immediately obtained or there was an error attempting to
@@ -143,7 +143,7 @@ CORE_mutex_Status _CORE_mutex_Initialize(
RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
CORE_mutex_Control *the_mutex,
Thread_Control *executing,
- ISR_Level level
+ ISR_lock_Context *lock_context
);
#if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__)
@@ -162,7 +162,7 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
int _CORE_mutex_Seize_interrupt_trylock(
CORE_mutex_Control *the_mutex,
Thread_Control *executing,
- ISR_Level level
+ ISR_lock_Context *lock_context
);
#else
/**
@@ -171,10 +171,10 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
*
* @param[in] _mutex will attempt to lock
* @param[in] _executing points to the executing thread
- * @param[in] _level is the interrupt level
+ * @param[in] _lock_context is the interrupt level
*/
- #define _CORE_mutex_Seize_interrupt_trylock( _mutex, _executing, _level ) \
- _CORE_mutex_Seize_interrupt_trylock_body( _mutex, _executing, _level )
+ #define _CORE_mutex_Seize_interrupt_trylock( _mutex, _executing, _lock_context ) \
+ _CORE_mutex_Seize_interrupt_trylock_body( _mutex, _executing, _lock_context )
#endif
/**
@@ -226,7 +226,7 @@ void _CORE_mutex_Seize_interrupt_blocking(
* @param[in] id is the Id of the owning API level Semaphore object
* @param[in] wait is true if the thread is willing to wait
* @param[in] timeout is the maximum number of ticks to block
- * @param[in] level is a temporary variable used to contain the ISR
+ * @param[in] lock_context is a temporary variable used to contain the ISR
* disable level cookie
*
* @note If the mutex is called from an interrupt service routine,
@@ -248,7 +248,7 @@ RTEMS_INLINE_ROUTINE void _CORE_mutex_Seize_body(
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
- ISR_Level level
+ ISR_lock_Context *lock_context
)
{
if ( _CORE_mutex_Check_dispatch_for_seize( wait ) ) {
@@ -258,9 +258,9 @@ RTEMS_INLINE_ROUTINE void _CORE_mutex_Seize_body(
INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE
);
}
- if ( _CORE_mutex_Seize_interrupt_trylock( the_mutex, executing, level ) ) {
+ if ( _CORE_mutex_Seize_interrupt_trylock( the_mutex, executing, lock_context ) ) {
if ( !wait ) {
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( lock_context );
executing->Wait.return_code =
CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
} else {
@@ -268,7 +268,7 @@ RTEMS_INLINE_ROUTINE void _CORE_mutex_Seize_body(
executing->Wait.queue = &the_mutex->Wait_queue;
executing->Wait.id = id;
_Thread_Disable_dispatch();
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( lock_context );
_CORE_mutex_Seize_interrupt_blocking( the_mutex, executing, timeout );
}
}
@@ -282,7 +282,7 @@ RTEMS_INLINE_ROUTINE void _CORE_mutex_Seize_body(
* @param[in] _id is the Id of the owning API level Semaphore object
* @param[in] _wait is true if the thread is willing to wait
* @param[in] _timeout is the maximum number of ticks to block
- * @param[in] _level is a temporary variable used to contain the ISR
+ * @param[in] _lock_context is a temporary variable used to contain the ISR
* disable level cookie
*/
#if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__)
@@ -292,13 +292,13 @@ RTEMS_INLINE_ROUTINE void _CORE_mutex_Seize_body(
Objects_Id _id,
bool _wait,
Watchdog_Interval _timeout,
- ISR_Level _level
+ ISR_lock_Context *_lock_context
);
#else
#define _CORE_mutex_Seize( \
- _the_mutex, _executing, _id, _wait, _timeout, _level ) \
+ _the_mutex, _executing, _id, _wait, _timeout, _lock_context ) \
_CORE_mutex_Seize_body( \
- _the_mutex, _executing, _id, _wait, _timeout, _level )
+ _the_mutex, _executing, _id, _wait, _timeout, _lock_context )
#endif
/**
@@ -442,7 +442,7 @@ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_priority_ceiling(
RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
CORE_mutex_Control *the_mutex,
Thread_Control *executing,
- ISR_Level level
+ ISR_lock_Context *lock_context
)
{
/* disabled when you get here */
@@ -464,7 +464,7 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
}
if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( lock_context );
return 0;
} /* else must be CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING
*
@@ -478,13 +478,13 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
ceiling = the_mutex->Attributes.priority_ceiling;
current = executing->current_priority;
if ( current == ceiling ) {
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( lock_context );
return 0;
}
if ( current > ceiling ) {
_Thread_Disable_dispatch();
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( lock_context );
_Thread_Change_priority(
executing,
ceiling,
@@ -498,7 +498,7 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
the_mutex->holder = NULL;
the_mutex->nest_count = 0; /* undo locking above */
executing->resource_count--; /* undo locking above */
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( lock_context );
return 0;
}
}
@@ -514,12 +514,12 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
switch ( the_mutex->Attributes.lock_nesting_behavior ) {
case CORE_MUTEX_NESTING_ACQUIRES:
the_mutex->nest_count++;
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( lock_context );
return 0;
#if defined(RTEMS_POSIX_API)
case CORE_MUTEX_NESTING_IS_ERROR:
executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( lock_context );
return 0;
#endif
case CORE_MUTEX_NESTING_BLOCKS:
diff --git a/cpukit/score/include/rtems/score/coresemimpl.h b/cpukit/score/include/rtems/score/coresemimpl.h
index fda908ec83..99303d7aa3 100644
--- a/cpukit/score/include/rtems/score/coresemimpl.h
+++ b/cpukit/score/include/rtems/score/coresemimpl.h
@@ -203,7 +203,7 @@ RTEMS_INLINE_ROUTINE uint32_t _CORE_semaphore_Get_count(
* @param[in] id is the Id of the owning API level Semaphore object
* @param[in] wait is true if the thread is willing to wait
* @param[in] timeout is the maximum number of ticks to block
- * @param[in] level is a temporary variable used to contain the ISR
+ * @param[in] lock_context is a temporary variable used to contain the ISR
* disable level cookie
*
* @note There is currently no MACRO version of this routine.
@@ -214,7 +214,7 @@ RTEMS_INLINE_ROUTINE void _CORE_semaphore_Seize_isr_disable(
Objects_Id id,
bool wait,
Watchdog_Interval timeout,
- ISR_Level level
+ ISR_lock_Context *lock_context
)
{
/* disabled when you get here */
@@ -222,12 +222,12 @@ RTEMS_INLINE_ROUTINE void _CORE_semaphore_Seize_isr_disable(
executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
if ( the_semaphore->count != 0 ) {
the_semaphore->count -= 1;
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( lock_context );
return;
}
if ( !wait ) {
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( lock_context );
executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT;
return;
}
@@ -236,7 +236,7 @@ RTEMS_INLINE_ROUTINE void _CORE_semaphore_Seize_isr_disable(
_Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue );
executing->Wait.queue = &the_semaphore->Wait_queue;
executing->Wait.id = id;
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( lock_context );
_Thread_queue_Enqueue( &the_semaphore->Wait_queue, executing, timeout );
_Thread_Enable_dispatch();
diff --git a/cpukit/score/include/rtems/score/objectimpl.h b/cpukit/score/include/rtems/score/objectimpl.h
index d24f5847b8..a137deace3 100644
--- a/cpukit/score/include/rtems/score/objectimpl.h
+++ b/cpukit/score/include/rtems/score/objectimpl.h
@@ -21,7 +21,7 @@
#include <rtems/score/object.h>
#include <rtems/score/apimutex.h>
-#include <rtems/score/isrlevel.h>
+#include <rtems/score/isrlock.h>
#include <rtems/score/threaddispatch.h>
#ifdef __cplusplus
@@ -539,7 +539,7 @@ Objects_Control *_Objects_Get (
* @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] level is the interrupt level being turned.
+ * @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
@@ -555,7 +555,7 @@ Objects_Control *_Objects_Get_isr_disable(
Objects_Information *information,
Objects_Id id,
Objects_Locations *location,
- ISR_Level *level
+ ISR_lock_Context *lock_context
);
/**