forked from Imagelibrary/rtems
score: Delete _Assert_Owner_of_giant()
Add _Debug_Is_owner_of_giant(). This makes it possible to assert the opposite.
This commit is contained in:
@@ -49,12 +49,14 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Asserts that current thread of execution owns the giant lock.
|
* @brief Returns true if the current thread of execution owns the giant lock.
|
||||||
*/
|
*/
|
||||||
#if defined( RTEMS_DEBUG ) && defined( RTEMS_SMP )
|
#if defined( RTEMS_DEBUG )
|
||||||
void _Assert_Owner_of_giant( void );
|
#if defined( RTEMS_SMP )
|
||||||
#else
|
bool _Debug_Is_owner_of_giant( void );
|
||||||
#define _Assert_Owner_of_giant() ( ( void ) 0 )
|
#else
|
||||||
|
#define _Debug_Is_owner_of_giant() (true)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ typedef uint32_t ISR_Level;
|
|||||||
#define _ISR_Disable( _level ) \
|
#define _ISR_Disable( _level ) \
|
||||||
do { \
|
do { \
|
||||||
_CPU_ISR_Disable( _level ); \
|
_CPU_ISR_Disable( _level ); \
|
||||||
_Assert_Owner_of_giant(); \
|
_Assert( _Debug_Is_owner_of_giant() ); \
|
||||||
RTEMS_COMPILER_MEMORY_BARRIER(); \
|
RTEMS_COMPILER_MEMORY_BARRIER(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ typedef uint32_t ISR_Level;
|
|||||||
#define _ISR_Enable( _level ) \
|
#define _ISR_Enable( _level ) \
|
||||||
do { \
|
do { \
|
||||||
RTEMS_COMPILER_MEMORY_BARRIER(); \
|
RTEMS_COMPILER_MEMORY_BARRIER(); \
|
||||||
_Assert_Owner_of_giant(); \
|
_Assert( _Debug_Is_owner_of_giant() ); \
|
||||||
_CPU_ISR_Enable( _level ); \
|
_CPU_ISR_Enable( _level ); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ typedef uint32_t ISR_Level;
|
|||||||
#define _ISR_Flash( _level ) \
|
#define _ISR_Flash( _level ) \
|
||||||
do { \
|
do { \
|
||||||
RTEMS_COMPILER_MEMORY_BARRIER(); \
|
RTEMS_COMPILER_MEMORY_BARRIER(); \
|
||||||
_Assert_Owner_of_giant(); \
|
_Assert( _Debug_Is_owner_of_giant() ); \
|
||||||
_CPU_ISR_Flash( _level ); \
|
_CPU_ISR_Flash( _level ); \
|
||||||
RTEMS_COMPILER_MEMORY_BARRIER(); \
|
RTEMS_COMPILER_MEMORY_BARRIER(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|||||||
@@ -142,13 +142,11 @@ void _Giant_Release( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined( RTEMS_DEBUG )
|
#if defined( RTEMS_DEBUG )
|
||||||
void _Assert_Owner_of_giant( void )
|
bool _Debug_Is_owner_of_giant( void )
|
||||||
{
|
{
|
||||||
Giant_Control *giant = &_Giant;
|
Giant_Control *giant = &_Giant;
|
||||||
|
|
||||||
_Assert(
|
return giant->owner_cpu == _SMP_Get_current_processor()
|
||||||
giant->owner_cpu == _SMP_Get_current_processor()
|
|| !_System_state_Is_up( _System_state_Get() );
|
||||||
|| !_System_state_Is_up( _System_state_Get() )
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user