gettimeofday seconds rollover problem?
Chris Johns
chrisj at rtems.org
Thu Feb 23 23:40:03 UTC 2006
Joel Sherrill wrote:
>
> This is the C code we are looking at the assembly for, correct?
>
Yes.
> rtems_interrupt_disable(level);
> seconds = _TOD_Seconds_since_epoch;
> microseconds = _TOD_Current.ticks;
> rtems_interrupt_enable(level);
>
> and the assembly inlines for that are:
>
> #define m68k_disable_interrupts( _level ) \
> do { register uint32_t _tmpsr = 0x0700; \
> asm volatile ( "move.w %%sr,%0\n\t" \
> "or.l %0,%1\n\t" \
> "move.w %1,%%sr" \
> : "=d" (_level), "=d"(_tmpsr) : "1"(_tmpsr) ); \
> } while( 0 )
> #define m68k_enable_interrupts( _level ) \
> asm volatile ( "move.w %0,%%sr " : : "d" (_level));
>
> Which compiler did you check that with?
>
gcc 3.4.3 and gcc 4.0.2.
Regards
Chris
More information about the users
mailing list