rtems 4.9.0 rtems_clock_get API improvements.... not always
Maurizio Scavazzon
scavazzon at hotmail.com
Fri Jun 12 10:29:23 UTC 2009
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?
thank you.
Regards,
Maurizio
_________________________________________________________________
Quante ne sai? Gioca con Crosswire e mettiti alla prova!
http://livesearch.games.msn.com/crosswire/default_it/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20090612/67c39352/attachment.html>
More information about the users
mailing list