<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.3315.2870" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">During <SPAN
style="mso-spacerun: yes"> </SPAN>our tests we had <SPAN
style="mso-spacerun: yes"> </SPAN>a problem updating the internal Time of
Day.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office"
/><o:p></o:p></SPAN></FONT>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p> </o:p></SPAN><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">If we do a <SPAN
style="mso-spacerun: yes"> </SPAN><I
style="mso-bidi-font-style: normal">rtems_bsdnet_synchronize_ntp()</I><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>call, we verify <SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>that <SPAN
style="mso-spacerun: yes"> </SPAN>sometimes the date<SPAN
style="mso-spacerun: yes"> </SPAN>returned from<I
style="mso-bidi-font-style: normal"> rtems_clock_get()</I>
<SPAN style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>has the ticks field <SPAN
style="mso-spacerun: yes"> </SPAN></SPAN><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">greater then 1000 ms/_TOD_Ticks_per_second.
<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">If <SPAN
style="mso-spacerun: yes"> </SPAN>we watch the _TOD_Set<SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>function <SPAN
style="mso-spacerun: yes"> </SPAN>(c/src/exec/score/src/coretodset.c) we
can observe that the test on ticks_until_next_second is based on the old
_TOD_Current.ticks:</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p> -------------------------------------------------------------------------------------------------------------------</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p>
</o:p></SPAN><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">ticks_until_next_second =
_TOD_Ticks_per_second;<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><B
style="mso-bidi-font-weight: normal"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><SPAN
style="mso-spacerun: yes"> </SPAN>if
( ticks_until_next_second > _TOD_Current.ticks )<SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN><----<o:p></o:p></SPAN></B></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><B
style="mso-bidi-font-weight: normal"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><SPAN
style="mso-spacerun: yes">
</SPAN> ticks_until_next_second -=
_TOD_Current.ticks</SPAN></B><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">;<SPAN
style="mso-spacerun: yes"> </SPAN><B
style="mso-bidi-font-weight: normal"><----</B><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">
_TOD_Current<SPAN
style="mso-spacerun: yes">
</SPAN>= *the_tod;<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">
_TOD_Seconds_since_epoch =
seconds_since_epoch;<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">
_TOD_Is_set<SPAN
style="mso-spacerun: yes">
</SPAN>= TRUE;<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">
_TOD_Activate( ticks_until_next_second
);<o:p></o:p></SPAN></FONT></FONT></P><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p> ------------------------------------------------------------------------------------------------------------------</o:p></SPAN></FONT></P></o:p></SPAN>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p> </o:p></SPAN><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">After the test, <SPAN
style="mso-spacerun: yes"> '</SPAN>_TOD_Current.ticks' is updated with the
new value stored in the parameter <SPAN
style="mso-spacerun: yes"> </SPAN>‘the_tod’ <SPAN
style="mso-spacerun: yes"> </SPAN>but obviously <SPAN
style="mso-spacerun: yes"> </SPAN>previous calculated ‘ticks_until _next
second’ <SPAN style="mso-spacerun: yes"> </SPAN>is <SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="mso-spacerun: yes"> </SPAN>uncorrelated with the new value<SPAN
style="mso-spacerun: yes">
</SPAN>‘_TOD_Current’.<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">We avoided the problem updating <SPAN
style="mso-spacerun: yes"> </SPAN>‘_TOD_Current’ <SPAN
style="mso-spacerun: yes"> </SPAN>before the
test:<o:p></o:p></SPAN></FONT></FONT></P><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><SPAN style="mso-spacerun: yes">
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p> --------------------------------------------------------------------------------------------------------------------</o:p></SPAN></FONT></P></SPAN></SPAN>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><SPAN
style="mso-spacerun: yes"> </SPAN>_TOD_Current<SPAN
style="mso-spacerun: yes">
</SPAN>= *the_tod;<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><SPAN style="mso-spacerun: yes">
</SPAN>_TOD_Seconds_since_epoch =
seconds_since_epoch;<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><SPAN style="mso-spacerun: yes">
</SPAN>_TOD_Is_set<SPAN
style="mso-spacerun: yes">
</SPAN>= TRUE;<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p>
</o:p></SPAN><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><SPAN
style="mso-spacerun: yes"></SPAN>ticks_until_next_second =
_TOD_Ticks_per_second;<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><SPAN style="mso-spacerun: yes">
</SPAN>if ( ticks_until_next_second > _TOD_Current.ticks
)<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><SPAN
style="mso-spacerun: yes">
</SPAN>ticks_until_next_second -=
_TOD_Current.ticks;<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"> _TOD_Activate(
ticks_until_next_second );<o:p></o:p></SPAN></FONT></FONT></P><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p> -------------------------------------------------------------------------------------------------------------------</o:p></SPAN></FONT></P><FONT
size=2><FONT face="Courier New">
<P class=MsoNormal> </o:p></FONT></FONT></SPAN><FONT size=2><FONT
face="Courier New"><SPAN lang=EN-GB style="mso-ansi-language: EN-GB">Before the
patch we are unable to obtain a NTP synchronization between different CPUs on
Ethernet network better then 1 Sec <o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">After the patch we are capable to obtain
synchronization in term of 1 tick system CPU clock between CPUs.
<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p> </o:p></SPAN><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">Can anyone confirm the problem or is <SPAN
style="mso-spacerun: yes"> </SPAN>there an error in our
analysis?<o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p> </o:p></SPAN></FONT><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p><FONT face="Courier New" size=2>
</FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="FONT-FAMILY: Arial; mso-ansi-language: EN-GB">Thanks in
advance.</SPAN><SPAN lang=EN-GB
style="FONT-SIZE: 12pt; mso-ansi-language: EN-GB"><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="FONT-SIZE: 12pt; mso-ansi-language: EN-GB"> </SPAN><SPAN lang=EN-GB
style="FONT-FAMILY: Arial; mso-ansi-language: EN-GB">Fabrizio
Pirovano</SPAN><SPAN lang=EN-GB
style="FONT-SIZE: 12pt; mso-ansi-language: EN-GB"><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="FONT-SIZE: 12pt; mso-ansi-language: EN-GB"> </SPAN><SPAN lang=EN-GB
style="FONT-FAMILY: Arial; mso-ansi-language: EN-GB">THYSYS s.r.l.</SPAN><SPAN
lang=EN-GB
style="FONT-SIZE: 12pt; mso-ansi-language: EN-GB"><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><FONT size=2><FONT face="Courier New"><SPAN lang=EN-GB
style="FONT-FAMILY: Arial; mso-ansi-language: EN-GB">
Milan</SPAN><SPAN lang=EN-GB
style="FONT-FAMILY: Arial; mso-ansi-language: EN-GB">
Italy</SPAN><SPAN lang=EN-GB
style="FONT-SIZE: 12pt; mso-ansi-language: EN-GB"><o:p></o:p></SPAN></FONT></FONT></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: Arial"><A
href="mailto:pirovano.thysys@tiscalinet.it"><FONT face="Courier New"
size=2><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB">pirovano.thysys@tiscalinet.it</SPAN></FONT></A></SPAN><SPAN
lang=EN-GB
style="FONT-SIZE: 12pt; mso-ansi-language: EN-GB"><o:p></o:p></SPAN></P></o:p></SPAN>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN lang=EN-GB
style="mso-ansi-language: EN-GB"><o:p> </o:p></SPAN></FONT></P></FONT></DIV></FONT></DIV></BODY></HTML>