summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
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/src
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/src')
-rw-r--r--cpukit/score/src/profilingsmplock.c18
-rw-r--r--cpukit/score/src/smp.c3
2 files changed, 11 insertions, 10 deletions
diff --git a/cpukit/score/src/profilingsmplock.c b/cpukit/score/src/profilingsmplock.c
index be60ba9dee..a77e1a1092 100644
--- a/cpukit/score/src/profilingsmplock.c
+++ b/cpukit/score/src/profilingsmplock.c
@@ -21,19 +21,19 @@
#if defined( RTEMS_PROFILING )
SMP_lock_Stats_control _SMP_lock_Stats_control = {
.Lock = {
- .ticket_lock = {
+ .Ticket_lock = {
.next_ticket = ATOMIC_INITIALIZER_UINT( 0U ),
- .now_serving = ATOMIC_INITIALIZER_UINT( 0U ),
- .Stats = {
- .Node = CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN(
- &_SMP_lock_Stats_control.Stats_chain
- ),
- .name = "SMP lock stats"
- }
+ .now_serving = ATOMIC_INITIALIZER_UINT( 0U )
+ },
+ .Stats = {
+ .Node = CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN(
+ &_SMP_lock_Stats_control.Stats_chain
+ ),
+ .name = "SMP Lock Stats"
}
},
.Stats_chain = CHAIN_INITIALIZER_ONE_NODE(
- &_SMP_lock_Stats_control.Lock.ticket_lock.Stats.Node
+ &_SMP_lock_Stats_control.Lock.Stats.Node
),
.Iterator_chain = CHAIN_INITIALIZER_EMPTY(
_SMP_lock_Stats_control.Iterator_chain
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index 8ffeb1d828..a64287e51a 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -80,7 +80,8 @@ void _SMP_Handler_initialize( void )
for ( cpu_index = 0 ; cpu_index < cpu_max; ++cpu_index ) {
Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
- _SMP_ticket_lock_Initialize( &cpu->Lock, "per-CPU" );
+ _SMP_ticket_lock_Initialize( &cpu->Lock );
+ _SMP_lock_Stats_initialize( &cpu->Lock_stats, "Per-CPU" );
}
/*