diff options
author | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 2008-01-25 20:14:45 +0000 |
---|---|---|
committer | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 2008-01-25 20:14:45 +0000 |
commit | 81f595760d1a5b85c7650c53957fc01fe17582c6 (patch) | |
tree | f1859c79870cc9a1aa9045dadbb584c6e57a743d | |
parent | 2008-01-25 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-81f595760d1a5b85c7650c53957fc01fe17582c6.tar.bz2 |
2008-01-25 Jennifer Averett <jennifer.averett@OARcorp.com>
* sapi/include/rtems/fatal.h, score/include/rtems/score/coremutex.h,
score/include/rtems/score/interr.h,
score/inline/rtems/score/thread.inl, score/src/coremutexseize.c:
Modifications to aid in full path testing.
Diffstat (limited to '')
-rw-r--r-- | cpukit/ChangeLog | 7 | ||||
-rw-r--r-- | cpukit/sapi/include/rtems/fatal.h | 2 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/coremutex.h | 18 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/interr.h | 3 | ||||
-rw-r--r-- | cpukit/score/inline/rtems/score/thread.inl | 10 | ||||
-rw-r--r-- | cpukit/score/src/coremutexseize.c | 13 |
6 files changed, 48 insertions, 5 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index c441d77886..4774859083 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,10 @@ +2008-01-25 Jennifer Averett <jennifer.averett@OARcorp.com> + + * sapi/include/rtems/fatal.h, score/include/rtems/score/coremutex.h, + score/include/rtems/score/interr.h, + score/inline/rtems/score/thread.inl, score/src/coremutexseize.c: + Modifications to aid in full path testing. + 2008-01-25 Joel Sherrill <joel.sherrill@oarcorp.com> * posix/src/mqueuesendsupp.c: Remove warning. diff --git a/cpukit/sapi/include/rtems/fatal.h b/cpukit/sapi/include/rtems/fatal.h index 9d870776c4..8185726ebe 100644 --- a/cpukit/sapi/include/rtems/fatal.h +++ b/cpukit/sapi/include/rtems/fatal.h @@ -41,7 +41,7 @@ extern "C" { void rtems_fatal_error_occurred( uint32_t the_error -); +) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; #ifdef __cplusplus } diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h index f78232a0fb..5f6627f932 100644 --- a/cpukit/score/include/rtems/score/coremutex.h +++ b/cpukit/score/include/rtems/score/coremutex.h @@ -354,7 +354,8 @@ void _CORE_mutex_Seize_interrupt_blocking( * * If the caller is willing to wait * then they are blocked. */ -#define _CORE_mutex_Seize( \ + +#define _CORE_mutex_Seize_body( \ _the_mutex, _id, _wait, _timeout, _level ) \ do { \ if ( _Thread_Dispatch_disable_level \ @@ -364,7 +365,8 @@ void _CORE_mutex_Seize_interrupt_blocking( _Internal_error_Occurred( \ INTERNAL_ERROR_CORE, \ FALSE, \ - 18 /* called from wrong environment */); \ + INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE \ + ); \ } \ if ( _CORE_mutex_Seize_interrupt_trylock( _the_mutex, &_level ) ) { \ if ( !_wait ) { \ @@ -382,6 +384,18 @@ void _CORE_mutex_Seize_interrupt_blocking( } \ } while (0) +#if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) + void _CORE_mutex_Seize( + CORE_mutex_Control *_the_mutex, + Objects_Id _id, + boolean _wait, + Watchdog_Interval _timeout, + ISR_Level _level + ); +#else + #define _CORE_mutex_Seize( _the_mutex, _id, _wait, _timeout, _level ) \ + _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ) +#endif /** * @brief Surrender the Mutex * diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h index a8792c334b..5666ddfb7e 100644 --- a/cpukit/score/include/rtems/score/interr.h +++ b/cpukit/score/include/rtems/score/interr.h @@ -64,7 +64,8 @@ typedef enum { INTERNAL_ERROR_BAD_STACK_HOOK, INTERNAL_ERROR_BAD_ATTRIBUTES, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY, - INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL + INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL, + INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE } Internal_errors_Core_list; /** diff --git a/cpukit/score/inline/rtems/score/thread.inl b/cpukit/score/inline/rtems/score/thread.inl index 6f58652a2c..9ce734c773 100644 --- a/cpukit/score/inline/rtems/score/thread.inl +++ b/cpukit/score/inline/rtems/score/thread.inl @@ -19,6 +19,8 @@ #ifndef _RTEMS_SCORE_THREAD_INL #define _RTEMS_SCORE_THREAD_INL +#include <rtems/score/sysstate.h> + /** * @addtogroup ScoreThread * @{ @@ -32,7 +34,13 @@ RTEMS_INLINE_ROUTINE void _Thread_Stop_multitasking( void ) { - _Context_Switch( &_Thread_Executing->Registers, &_Thread_BSP_context ); + Context_Control context_area; + Context_Control *context_p = &context_area; + + if ( _System_state_Is_up(_System_state_Get ()) ) + context_p = &_Thread_Executing->Registers; + + _Context_Switch( context_p, &_Thread_BSP_context ); } /** diff --git a/cpukit/score/src/coremutexseize.c b/cpukit/score/src/coremutexseize.c index 2fdc4d6fc4..3dc3a70c5b 100644 --- a/cpukit/score/src/coremutexseize.c +++ b/cpukit/score/src/coremutexseize.c @@ -27,6 +27,19 @@ #include <rtems/score/thread.h> #include <rtems/score/threadq.h> +#if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) +void _CORE_mutex_Seize( + CORE_mutex_Control *_the_mutex, + Objects_Id _id, + boolean _wait, + Watchdog_Interval _timeout, + ISR_Level _level +) +{ + _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); +} +#endif + /*PAGE * * _CORE_mutex_Seize (interrupt blocking support) |