<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for examples-v2 (2011-03-03)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-03 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1749/bsps
* Makefile: Add new test program for wrapping clock tick.
* nanosecond_tick_wrap/.cvsignore, nanosecond_tick_wrap/Makefile,
nanosecond_tick_wrap/README, nanosecond_tick_wrap/init.c: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//examples-v2/misc/ChangeLog.diff?r1=text&tr1=1.11&r2=text&tr2=1.12&diff_format=h">M</a></td><td width='1%'>1.12</td><td width='100%'>misc/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//examples-v2/misc/Makefile.diff?r1=text&tr1=1.5&r2=text&tr2=1.6&diff_format=h">M</a></td><td width='1%'>1.6</td><td width='100%'>misc/Makefile</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//examples-v2/misc/nanosecond_tick_wrap/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">misc/nanosecond_tick_wrap/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//examples-v2/misc/nanosecond_tick_wrap/Makefile?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">misc/nanosecond_tick_wrap/Makefile</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//examples-v2/misc/nanosecond_tick_wrap/README?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">misc/nanosecond_tick_wrap/README</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//examples-v2/misc/nanosecond_tick_wrap/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">misc/nanosecond_tick_wrap/init.c</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u examples-v2/misc/ChangeLog:1.11 examples-v2/misc/ChangeLog:1.12
--- examples-v2/misc/ChangeLog:1.11 Wed May 5 10:29:54 2010
+++ examples-v2/misc/ChangeLog Thu Mar 3 08:38:53 2011
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2011-03-03 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ PR 1749/bsps
+ * Makefile: Add new test program for wrapping clock tick.
+ * nanosecond_tick_wrap/.cvsignore, nanosecond_tick_wrap/Makefile,
+ nanosecond_tick_wrap/README, nanosecond_tick_wrap/init.c: New files.
+
</font> 2010-05-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* qemu_vfat/Makefile, qemu_vfat/README, qemu_vfat/init.c: Now includes
<font color='#006600'>diff -u examples-v2/misc/Makefile:1.5 examples-v2/misc/Makefile:1.6
--- examples-v2/misc/Makefile:1.5 Thu Apr 8 11:38:29 2010
+++ examples-v2/misc/Makefile Thu Mar 3 08:38:54 2011
</font><font color='#997700'>@@ -6,7 +6,7 @@
</font> include $(RTEMS_CUSTOM)
include $(RTEMS_ROOT)/make/directory.cfg
<font color='#880000'>-SUBDIRS=minimum bspcmdline extract_example
</font><font color='#000088'>+SUBDIRS=minimum bspcmdline extract_example nanosecond_tick_wrap
</font>
# If the POSIX API isn't enabled, we can't build these
ifeq ($(RTEMS_HAS_POSIX_API),yes)
<font color='#006600'>diff -u /dev/null examples-v2/misc/nanosecond_tick_wrap/.cvsignore:1.1
--- /dev/null Thu Mar 3 09:10:05 2011
+++ examples-v2/misc/nanosecond_tick_wrap/.cvsignore Thu Mar 3 08:38:54 2011
</font><font color='#997700'>@@ -0,0 +1 @@
</font><font color='#000088'>+o-optimize
</font>
<font color='#006600'>diff -u /dev/null examples-v2/misc/nanosecond_tick_wrap/Makefile:1.1
--- /dev/null Thu Mar 3 09:10:05 2011
+++ examples-v2/misc/nanosecond_tick_wrap/Makefile Thu Mar 3 08:38:54 2011
</font><font color='#997700'>@@ -0,0 +1,27 @@
</font><font color='#000088'>+#
+# $Id$
+#
+
+#
+# RTEMS_MAKEFILE_PATH is typically set in an environment variable
+#
+
+PGM=${ARCH}/nanoseconds_tick_wrap.exe
+
+# optional managers required
+MANAGERS=all
+
+# C source names
+CSRCS = init.c
+COBJS = $(CSRCS:%.c=${ARCH}/%.o)
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_CUSTOM)
+include $(PROJECT_ROOT)/make/leaf.cfg
+
+OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS)
+
+all: ${ARCH} $(PGM)
+
+$(PGM): $(OBJS)
+ $(make-exe)
</font>
<font color='#006600'>diff -u /dev/null examples-v2/misc/nanosecond_tick_wrap/README:1.1
--- /dev/null Thu Mar 3 09:10:06 2011
+++ examples-v2/misc/nanosecond_tick_wrap/README Thu Mar 3 08:38:54 2011
</font><font color='#997700'>@@ -0,0 +1,32 @@
</font><font color='#000088'>+#
+# $Id$
+#
+
+PR 1748 [1] points out a general problem that many BSPs could have in their
+nanoseconds since last tick handler. This problem occurs when:
+
++ We are in the middle of getting TOD or Update AND
++ Clock tick counter goes to 0<span style="background-color: #FF0000"> </span>
+<span style="background-color: #FF0000"> </span>
+Then the nanoseconds since last tick handler needs to account for either
+a clock interrupt pending (if the counter resets) or the counter wrapping
+below 0. The following illustrates the interrupt pending method:
+
+iuint32_t bsp_clock_nanoseconds_since_last_tick(void)
+{
+ uint32_t clicks;
+ uint32_t usecs;
+
+ clicks = HARDWARE_COUNTER;
+
+ usecs = TO_USECS(clicks);
+ if ( Is_interrupt_pending( CLOCK_VECTOR ) )
+ usecs += rtems_configuration_get_microseconds_per_tick();
+ return usecs * 1000;
+}
+
+
+References
+==========
+
+[1] https://www.rtems.org/bugzilla/show_bug.cgi?id=1748
</font>
<font color='#006600'>diff -u /dev/null examples-v2/misc/nanosecond_tick_wrap/init.c:1.1
--- /dev/null Thu Mar 3 09:10:06 2011
+++ examples-v2/misc/nanosecond_tick_wrap/init.c Thu Mar 3 08:38:54 2011
</font><font color='#997700'>@@ -0,0 +1,73 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+/* Based upon code in PR1748 */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <bsp.h>
+
+#define LOOPS 1000
+uint32_t uptime_usec[LOOPS];
+struct timespec uptime[LOOPS];
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ int i;
+ uint32_t t0=0;
+
+ puts( "\n\n*** Nanosecond Clock Tick Wrap Test ***" );
+ for ( i=0; i<LOOPS; i++ ) {
+
+ rtems_clock_get_uptime( &uptime[i] );
+ uptime_usec[i] = ((uint32_t)uptime[i].tv_sec * 1000000) +
+ ((uint32_t)uptime[i].tv_nsec / 1000);
+ }
+
+ for ( i=0; i<LOOPS; i++ ) {
+ unsigned t1, usec, msec, sec;
+
+ t1 = uptime_usec[i];
+ usec = t1 % 1000;
+ msec = (t1 / 1000) % 1000;
+ sec = t1 / 1000000;
+
+ printf(
+ "TEST:rtems=%u.%09u t=%u.%03u.%03u dt=%u\n",
+ uptime[i].tv_sec, uptime[i].tv_nsec, sec, msec, usec, (t1-t0)
+ );
+ t0 = t1;
+ }
+
+ puts( "*** END OF Nanosecond Clock Tick Wrap Test ***" );
+ exit(0);
+}
+
+/**************** START OF CONFIGURATION INFORMATION ****************/
+
+#define CONFIGURE_INIT
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MICROSECONDS_PER_TICK \
+ (RTEMS_MILLISECONDS_TO_MICROSECONDS(1) / 2)
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#include <rtems/confdefs.h>
+
+/**************** END OF CONFIGURATION INFORMATION ****************/
+
</font></pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>Fix pr number.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//examples-v2/misc/ChangeLog.diff?r1=text&tr1=1.12&r2=text&tr2=1.13&diff_format=h">M</a></td><td width='1%'>1.13</td><td width='100%'>misc/ChangeLog</td></tr>
</table>
<pre>
<font color='#006600'>diff -u examples-v2/misc/ChangeLog:1.12 examples-v2/misc/ChangeLog:1.13
--- examples-v2/misc/ChangeLog:1.12 Thu Mar 3 08:38:53 2011
+++ examples-v2/misc/ChangeLog Thu Mar 3 08:39:19 2011
</font><font color='#997700'>@@ -1,6 +1,6 @@
</font> 2011-03-03 Joel Sherrill <joel.sherrill@oarcorp.com>
<font color='#880000'>- PR 1749/bsps
</font><font color='#000088'>+ PR 1748/bsps
</font> * Makefile: Add new test program for wrapping clock tick.
* nanosecond_tick_wrap/.cvsignore, nanosecond_tick_wrap/Makefile,
nanosecond_tick_wrap/README, nanosecond_tick_wrap/init.c: New files.
</pre>
<p> </p>
<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>