[PATCH] rtems: Fix _Rate_monotonic_Renew_deadline()

Kuan Hsun Chen kuan-hsun.chen at tu-dortmund.de
Wed Jan 25 15:10:40 UTC 2017


Hi Sebastian,

Should I test the overflow condition together with sp69 or prepare a new
test for this matter?

Best,
Kuan-Hsun

2017-01-25 15:53 GMT+01:00 Sebastian Huber <
sebastian.huber at embedded-brains.de>:

>
>
> On 25/01/17 15:48, Kuan-Hsun Chen wrote:
>
>> ---
>>   cpukit/rtems/src/ratemontimeout.c | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/cpukit/rtems/src/ratemontimeout.c
>> b/cpukit/rtems/src/ratemontimeout.c
>> index bcc4ccf..079ad41 100644
>> --- a/cpukit/rtems/src/ratemontimeout.c
>> +++ b/cpukit/rtems/src/ratemontimeout.c
>> @@ -9,7 +9,7 @@
>>    *  COPYRIGHT (c) 1989-2009.
>>    *  On-Line Applications Research Corporation (OAR).
>>    *
>> - *  COPYRIGHT (c) 2016 Kuan-Hsun Chen.
>> + *  COPYRIGHT (c) 2017 Kuan-Hsun Chen.
>>
>
> This should be 2016, 2017 or 2016-2017.
>
>    *
>>    *  The license and distribution terms for this file may be
>>    *  found in the file LICENSE in this distribution or at
>> @@ -30,7 +30,10 @@ static void _Rate_monotonic_Renew_deadline(
>>   {
>>     uint64_t deadline;
>>
>> -  ++the_period->postponed_jobs;
>> +  /** stay at 0xffffffff if postponed_jobs is going to overflow */
>>
>
> /** is a Doxygen comment.
>
> +  if ( the_period->postponed_jobs != UINT_MAX ) {
>> +    ++the_period->postponed_jobs;
>> +  }
>>
>
> Type is uint32_t, not unsigned int. So, use UINT32_MAX. Maybe
>
>  Empty lines between blocks.
>
>     the_period->state = RATE_MONOTONIC_EXPIRED;
>>
>>     deadline = _Watchdog_Per_CPU_insert_relative(
>>
>
> We need a test case for this overflow condition. You probably have to
> modify the_period->postponed_jobs by hand in the test case to avoid
> extremely long test run times.
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax     : +49 89 189 47 41-09
> E-Mail  : sebastian.huber at embedded-brains.de
> PGP     : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>



-- 
M.Sc. Kuan-Hsun Chen

TU Dortmund
Department of Computer Science 12
Design Automation of Embedded Systems
Otto-Hahn-Strasse 16, Room 102

44227 Dortmund
Germany

Phone:  *+49 231 755 6124*
Mail:   kuan-hsun.chen at tu-dortmund.de <kuan-hsun.chen at tu-dortmund.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20170125/18e1bc9a/attachment-0002.html>


More information about the devel mailing list