summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/percpu.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-25 11:24:44 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-06-26 09:22:41 +0200
commitd811daca691e1fe9e8166fe20118148442f266a1 (patch)
tree017afda9dda2e68e9a2893d06d8983abfb2506dc /cpukit/score/include/rtems/score/percpu.h
parentlibmisc: Simplify <rtems/stackchk.h> (diff)
downloadrtems-d811daca691e1fe9e8166fe20118148442f266a1.tar.bz2
score: Hide SMP lock profiling impl if disabled
The problem is that empty structures have a different size in C and C++.
Diffstat (limited to 'cpukit/score/include/rtems/score/percpu.h')
-rw-r--r--cpukit/score/include/rtems/score/percpu.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h
index a6f7a25cc6..088c31f916 100644
--- a/cpukit/score/include/rtems/score/percpu.h
+++ b/cpukit/score/include/rtems/score/percpu.h
@@ -319,10 +319,17 @@ typedef struct Per_CPU_Control {
*/
SMP_ticket_lock_Control Lock;
- /**
- * @brief Lock statistics context for the per-CPU lock.
- */
- SMP_lock_Stats_context Lock_stats_context;
+ #if defined( RTEMS_PROFILING )
+ /**
+ * @brief Lock statistics for the per-CPU lock.
+ */
+ SMP_lock_Stats Lock_stats;
+
+ /**
+ * @brief Lock statistics context for the per-CPU lock.
+ */
+ SMP_lock_Stats_context Lock_stats_context;
+ #endif
/**
* @brief Context for the Giant lock acquire and release pair of this
@@ -385,6 +392,7 @@ extern Per_CPU_Control_envelope _Per_CPU_Information[] CPU_STRUCTURE_ALIGNMENT;
#define _Per_CPU_Acquire( cpu ) \
_SMP_ticket_lock_Acquire( \
&( cpu )->Lock, \
+ &( cpu )->Lock_stats, \
&( cpu )->Lock_stats_context \
)
#else
@@ -398,6 +406,7 @@ extern Per_CPU_Control_envelope _Per_CPU_Information[] CPU_STRUCTURE_ALIGNMENT;
#define _Per_CPU_Release( cpu ) \
_SMP_ticket_lock_Release( \
&( cpu )->Lock, \
+ &( cpu )->Lock_stats, \
&( cpu )->Lock_stats_context \
)
#else