summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spcbssched02
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-21 10:59:32 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-21 16:38:34 +0100
commitc1e350ca90f862d332d25863ea9e7c2ed05837c9 (patch)
tree94d9e19238a58c54314c4316e4ba0d65b6f2b6ef /testsuites/sptests/spcbssched02
parentarm: Add _CPU_Thread_Idle_body for ARMv7-M (diff)
downloadrtems-c1e350ca90f862d332d25863ea9e7c2ed05837c9.tar.bz2
sptests/spcbssched02: PR2081: Workaround
Avoid uninitialized stack variable. This is not a proper fix. It is not clear what the task should do if argument != 1.
Diffstat (limited to 'testsuites/sptests/spcbssched02')
-rw-r--r--testsuites/sptests/spcbssched02/task_periodic.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/testsuites/sptests/spcbssched02/task_periodic.c b/testsuites/sptests/spcbssched02/task_periodic.c
index a3a6edf58b..defaa00c21 100644
--- a/testsuites/sptests/spcbssched02/task_periodic.c
+++ b/testsuites/sptests/spcbssched02/task_periodic.c
@@ -30,7 +30,7 @@ rtems_task Task_Periodic(
int start, stop, now;
- rtems_cbs_server_id server_id, tsid;
+ rtems_cbs_server_id server_id = 0, tsid;
rtems_cbs_parameters params, tparams;
params.deadline = Period;
@@ -115,13 +115,15 @@ rtems_task Task_Periodic(
rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now );
if ( now >= start + Execution ) break;
- if ( rtems_cbs_get_execution_time( server_id, &exec_time, &abs_time ) )
- printf( "ERROR: GET EXECUTION TIME FAILED\n" );
- if ( rtems_cbs_get_remaining_budget( server_id, &remaining_budget) )
- printf( "ERROR: GET REMAINING BUDGET FAILED\n" );
- if ( (remaining_budget + exec_time) > (Execution + 1) ) {
- printf( "ERROR: REMAINING BUDGET AND EXECUTION TIME MISMATCH\n" );
- rtems_test_exit( 0 );
+ if ( server_id != 0 ) {
+ if ( rtems_cbs_get_execution_time( server_id, &exec_time, &abs_time ) )
+ printf( "ERROR: GET EXECUTION TIME FAILED\n" );
+ if ( rtems_cbs_get_remaining_budget( server_id, &remaining_budget) )
+ printf( "ERROR: GET REMAINING BUDGET FAILED\n" );
+ if ( (remaining_budget + exec_time) > (Execution + 1) ) {
+ printf( "ERROR: REMAINING BUDGET AND EXECUTION TIME MISMATCH\n" );
+ rtems_test_exit( 0 );
+ }
}
}
rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &stop );