score: Convert to inline function

This commit is contained in:
Sebastian Huber
2013-07-17 15:20:03 +02:00
parent 9728ef357f
commit ac15b0716a

View File

@@ -235,31 +235,36 @@ void _CORE_mutex_Seize_interrupt_blocking(
* * If the caller is willing to wait * * If the caller is willing to wait
* then they are blocked. * then they are blocked.
*/ */
#define _CORE_mutex_Seize_body( \ RTEMS_INLINE_ROUTINE void _CORE_mutex_Seize_body(
_the_mutex, _id, _wait, _timeout, _level ) \ CORE_mutex_Control *the_mutex,
do { \ Objects_Id id,
if ( _CORE_mutex_Check_dispatch_for_seize(_wait) ) { \ bool wait,
_Internal_error_Occurred( \ Watchdog_Interval timeout,
INTERNAL_ERROR_CORE, \ ISR_Level level
false, \ )
INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE \ {
); \ if ( _CORE_mutex_Check_dispatch_for_seize( wait ) ) {
} \ _Internal_error_Occurred(
if ( _CORE_mutex_Seize_interrupt_trylock( _the_mutex, _level ) ) { \ INTERNAL_ERROR_CORE,
if ( !(_wait) ) { \ false,
_ISR_Enable( _level ); \ INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE
_Thread_Executing->Wait.return_code = \ );
CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT; \ }
} else { \ if ( _CORE_mutex_Seize_interrupt_trylock( the_mutex, level ) ) {
_Thread_queue_Enter_critical_section( &(_the_mutex)->Wait_queue ); \ if ( !wait ) {
_Thread_Executing->Wait.queue = &(_the_mutex)->Wait_queue; \ _ISR_Enable( level );
_Thread_Executing->Wait.id = _id; \ _Thread_Executing->Wait.return_code =
_Thread_Disable_dispatch(); \ CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
_ISR_Enable( _level ); \ } else {
_CORE_mutex_Seize_interrupt_blocking( _the_mutex, _timeout ); \ _Thread_queue_Enter_critical_section( &the_mutex->Wait_queue );
} \ _Thread_Executing->Wait.queue = &the_mutex->Wait_queue;
} \ _Thread_Executing->Wait.id = id;
} while (0) _Thread_Disable_dispatch();
_ISR_Enable( level );
_CORE_mutex_Seize_interrupt_blocking( the_mutex, timeout );
}
}
}
/** /**
* This method is used to obtain a core mutex. * This method is used to obtain a core mutex.