summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/coremuteximpl.h
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/rtems/score/coremuteximpl.h
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 '')
-rw-r--r--cpukit/score/include/rtems/score/coremuteximpl.h44
1 files changed, 22 insertions, 22 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: