rtems 4.9.0 rtems_clock_get API improvements.... not always

Joel Sherrill joel.sherrill at OARcorp.com
Fri Jun 12 11:58:27 UTC 2009


Maurizio Scavazzon wrote:
> Dear all,
>    I just upgraded  an old version of rtems (2002) to the newer 4.9.0.
>
> The real time application I'm working on, is based on a MCF5272 
> (66MHz), has a clock tick of 5 ms and the time consumption was about 
> 3.2 ms with the older rtems.
>
> With rtems 4.9.0, the time consumption is now 4.2 ms (for us is 
> unacceptable).
>
> What I see, using the debugger, is that the 1 ms comes from two calls 
> to the function rtems_clock_get inside the tick period.
>
> The new approach of "rtems_clock_get" is to call "rtems_clock_get_tod" 
> which calls "gmtime_r" and finally the "_mktm_r" function (located in 
> newlib).
>
> This should be the issue. The mktm_r function uses 5 divisions ("/") 
> and 5 module ("%") operators to compute the TOD. And these operators 
> make the execution time huge in a 66MHz processor. 
>
> The old approach was to keep the TOD updated at every clock tick using 
> just simple sums.
>
> Does anybody know if there is a way to avoid this issue?
Do you really need the Classic API TOD format or would you be
better served by using rtems_clock_get_timespec?

Alternatively do you have a faster algorithm for converting
seconds/nanoseconds into the Classic API TOD format.
>
> thank you.
>
> Regards,
> Maurizio
>
> ------------------------------------------------------------------------
> Scarica Messenger gratis: comunica, divertiti e condividi rapidamente! 
> <http://messenger.it/home_comunica.aspx>




More information about the users mailing list