RTEMS - rtems_clock_get_uptime() fails during timer tick

Joel Sherrill joel.sherrill at OARcorp.com
Thu Feb 24 13:28:32 UTC 2011


Can the BSP's get nanoseconds handler return a value that is
more than a clock tick?  This case is just on the edge of
wrapping the count down timer.  If the counter goes negative,
does the get nanoseconds since last tick handler in the
BSP "do the right thing"

On 02/24/2011 01:51 AM, Rolf Schroedter wrote:
> I tried to protect the call to rtems_clock_get_uptime() from interrupts
> (this was easier than to recompile RTEMS):
>
> #define _get_uptime( _ptr_uptime )        \
> {                        \
>       rtems_interrupt_level   _level;        \
>                           \
>       rtems_interrupt_disable(_level);        \
>       rtems_clock_get_uptime( _ptr_uptime );    \
>       rtems_interrupt_enable(_level);        \
> }
>
> But surprisingly (at least for me) this didn't solve the problem.
> Okay, I'll try to grab into the RTEMS sources.
>
> Thanks&  regards,
> Rolf.
>
>
> On 24.02.2011 01:23, Gedare Bloom wrote:
>> Hi,
>>
>> I suppose if your code is interrupting the rtems_clock_tick, this
>> behavior might happen. Can you try to add an ISR_Disable / ISR_Enable
>> protection around the call to "_Timestamp_Add_to(&_TOD_Uptime,&tick
>> );" in cpukit/score/src/coretodtickle.c and see if the problem
>> disappears?
>>
>> -Gedare
>>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users




More information about the users mailing list