summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-17 15:20:03 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-18 09:58:58 +0200
commitac15b0716af784c68b98076fc81e1d60d6d3f2bc (patch)
tree084742a034ebd385bcf3fda19902b0cd84816fb6 /cpukit/score/include
parentposix: Convert to inline function (diff)
downloadrtems-ac15b0716af784c68b98076fc81e1d60d6d3f2bc.tar.bz2
score: Convert to inline function
Diffstat (limited to 'cpukit/score/include')
-rw-r--r--cpukit/score/include/rtems/score/coremuteximpl.h55
1 files changed, 30 insertions, 25 deletions
diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h
index 69be9ac393..c35c0f3050 100644
--- a/cpukit/score/include/rtems/score/coremuteximpl.h
+++ b/cpukit/score/include/rtems/score/coremuteximpl.h
@@ -235,31 +235,36 @@ void _CORE_mutex_Seize_interrupt_blocking(
* * If the caller is willing to wait
* then they are blocked.
*/
-#define _CORE_mutex_Seize_body( \
- _the_mutex, _id, _wait, _timeout, _level ) \
- do { \
- if ( _CORE_mutex_Check_dispatch_for_seize(_wait) ) { \
- _Internal_error_Occurred( \
- INTERNAL_ERROR_CORE, \
- false, \
- INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE \
- ); \
- } \
- if ( _CORE_mutex_Seize_interrupt_trylock( _the_mutex, _level ) ) { \
- if ( !(_wait) ) { \
- _ISR_Enable( _level ); \
- _Thread_Executing->Wait.return_code = \
- CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT; \
- } else { \
- _Thread_queue_Enter_critical_section( &(_the_mutex)->Wait_queue ); \
- _Thread_Executing->Wait.queue = &(_the_mutex)->Wait_queue; \
- _Thread_Executing->Wait.id = _id; \
- _Thread_Disable_dispatch(); \
- _ISR_Enable( _level ); \
- _CORE_mutex_Seize_interrupt_blocking( _the_mutex, _timeout ); \
- } \
- } \
- } while (0)
+RTEMS_INLINE_ROUTINE void _CORE_mutex_Seize_body(
+ CORE_mutex_Control *the_mutex,
+ Objects_Id id,
+ bool wait,
+ Watchdog_Interval timeout,
+ ISR_Level level
+)
+{
+ if ( _CORE_mutex_Check_dispatch_for_seize( wait ) ) {
+ _Internal_error_Occurred(
+ INTERNAL_ERROR_CORE,
+ false,
+ INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE
+ );
+ }
+ if ( _CORE_mutex_Seize_interrupt_trylock( the_mutex, level ) ) {
+ if ( !wait ) {
+ _ISR_Enable( level );
+ _Thread_Executing->Wait.return_code =
+ CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
+ } else {
+ _Thread_queue_Enter_critical_section( &the_mutex->Wait_queue );
+ _Thread_Executing->Wait.queue = &the_mutex->Wait_queue;
+ _Thread_Executing->Wait.id = id;
+ _Thread_Disable_dispatch();
+ _ISR_Enable( level );
+ _CORE_mutex_Seize_interrupt_blocking( the_mutex, timeout );
+ }
+ }
+}
/**
* This method is used to obtain a core mutex.