2009-12-11 Glenn Humphrey <glenn.humphrey@OARcorp.com>

PR 1481/cpukit
	* rtems/src/ratemonperiod.c: Moved check for cpu usage being smaller
	than when period initiated.
This commit is contained in:
Glenn Humphrey
2009-12-11 22:03:35 +00:00
parent a06a3f712d
commit 33bdd10ef2
2 changed files with 10 additions and 4 deletions

View File

@@ -1,3 +1,9 @@
2009-12-11 Glenn Humphrey <glenn.humphrey@OARcorp.com>
PR 1481/cpukit
* rtems/src/ratemonperiod.c: Moved check for cpu usage being smaller
than when period initiated.
2009-12-10 Joel Sherrill <joel.sherrill@OARcorp.com> 2009-12-10 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1482 PR 1482

View File

@@ -135,16 +135,16 @@ void _Rate_monotonic_Update_statistics(
/* Grab CPU usage when the thread got switched in */ /* Grab CPU usage when the thread got switched in */
used = _Thread_Executing->cpu_time_used; used = _Thread_Executing->cpu_time_used;
/* partial period, cpu usage info reset while executing. Throw away */
if (_Timespec_Less_than( &used, &the_period->owner_executed_at_period))
return;
/* How much time time since last context switch */ /* How much time time since last context switch */
_Timespec_Subtract(&_Thread_Time_of_last_context_switch, &uptime, &ran); _Timespec_Subtract(&_Thread_Time_of_last_context_switch, &uptime, &ran);
/* executed += ran */ /* executed += ran */
_Timespec_Add_to( &used, &ran ); _Timespec_Add_to( &used, &ran );
/* partial period, cpu usage info reset while executing. Throw away */
if (_Timespec_Less_than( &used, &the_period->owner_executed_at_period))
return;
/* executed = current cpu usage - value at start of period */ /* executed = current cpu usage - value at start of period */
_Timespec_Subtract( _Timespec_Subtract(
&the_period->owner_executed_at_period, &used, &executed &the_period->owner_executed_at_period, &used, &executed