summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/assert.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-23 16:15:50 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-30 11:16:28 +0200
commitbf30999cc697325eda3afd1833b78a7e64255fc4 (patch)
treebc365daf0a3c0e6fe7c72cfe33c7603f7da54351 /cpukit/score/include/rtems/score/assert.h
parentsapi: SMP support for chains (diff)
downloadrtems-bf30999cc697325eda3afd1833b78a7e64255fc4.tar.bz2
smp: Add and use _Assert_Owner_of_giant()
Add and use _ISR_Disable_without_giant() and _ISR_Enable_without_giant() if RTEMS_SMP is defined. On single processor systems the ISR disable/enable was the big hammer which ensured system-wide mutual exclusion. On SMP configurations this no longer works since other processors do not care about disabled interrupts on this processor and continue to execute freely. On SMP in addition to ISR disable/enable an SMP lock must be used. Currently we have only the Giant lock so we can check easily that ISR disable/enable is used only in the right context.
Diffstat (limited to 'cpukit/score/include/rtems/score/assert.h')
-rw-r--r--cpukit/score/include/rtems/score/assert.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/assert.h b/cpukit/score/include/rtems/score/assert.h
index 174676e0e3..4856eae8b4 100644
--- a/cpukit/score/include/rtems/score/assert.h
+++ b/cpukit/score/include/rtems/score/assert.h
@@ -50,6 +50,15 @@ extern "C" {
#define _Assert_Thread_dispatching_repressed() ( ( void ) 0 )
#endif
+/**
+ * @brief Asserts that current thread of execution owns the giant lock.
+ */
+#if defined( RTEMS_DEBUG ) && defined( RTEMS_SMP )
+ void _Assert_Owner_of_giant( void );
+#else
+ #define _Assert_Owner_of_giant() ( ( void ) 0 )
+#endif
+
#ifdef __cplusplus
}
#endif /* __cplusplus */