<!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 rtems (2011-07-12)</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-07-12 Ricardo Aguirre <el.mastin@ymail.com>

        * Makefile.am, configure.ac, psxtmtests_plan.csv: Add psxtmmutex03.
        * psxtmmutex03/.cvsignore, psxtmmutex03/Makefile.am,
        psxtmmutex03/init.c, psxtmmutex03/psxtmmutex03.doc: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/ChangeLog.diff?r1=text&tr1=1.14&r2=text&tr2=1.15&diff_format=h">M</a></td><td width='1%'>1.15</td><td width='100%'>testsuites/psxtmtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/Makefile.am.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>testsuites/psxtmtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/configure.ac.diff?r1=text&tr1=1.6&r2=text&tr2=1.7&diff_format=h">M</a></td><td width='1%'>1.7</td><td width='100%'>testsuites/psxtmtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmmutex03/.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">testsuites/psxtmtests/psxtmmutex03/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmmutex03/Makefile.am?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">testsuites/psxtmtests/psxtmmutex03/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmmutex03/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">testsuites/psxtmtests/psxtmmutex03/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmmutex03/psxtmmutex03.doc?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">testsuites/psxtmtests/psxtmmutex03/psxtmmutex03.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmtests_plan.csv.diff?r1=text&tr1=1.7&r2=text&tr2=1.8&diff_format=h">M</a></td><td width='1%'>1.8</td><td width='100%'>testsuites/psxtmtests/psxtmtests_plan.csv</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/ChangeLog:1.14 rtems/testsuites/psxtmtests/ChangeLog:1.15
--- rtems/testsuites/psxtmtests/ChangeLog:1.14  Thu Jun 30 07:49:17 2011
+++ rtems/testsuites/psxtmtests/ChangeLog       Tue Jul 12 08:22:24 2011
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2011-07-12    Ricardo Aguirre <el.mastin@ymail.com>
+
+       * Makefile.am, configure.ac, psxtmtests_plan.csv: Add psxtmmutex03.
+       * psxtmmutex03/.cvsignore, psxtmmutex03/Makefile.am,
+       psxtmmutex03/init.c, psxtmmutex03/psxtmmutex03.doc: New files.
+
</font> 2011-06-29        Ricardo Aguirre <el.mastin@ymail.com>
 
        * psxtmtests/Makefile.am, psxtmtests/configure.ac,

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/Makefile.am:1.4 rtems/testsuites/psxtmtests/Makefile.am:1.5
--- rtems/testsuites/psxtmtests/Makefile.am:1.4 Wed Jun 29 14:09:11 2011
+++ rtems/testsuites/psxtmtests/Makefile.am     Tue Jul 12 08:22:24 2011
</font><font color='#997700'>@@ -12,6 +12,7 @@
</font> SUBDIRS += psxtmthread03
 SUBDIRS += psxtmnanosleep01
 SUBDIRS += psxtmnanosleep02
<font color='#000088'>+SUBDIRS += psxtmmutex03
</font> endif
 
 DIST_SUBDIRS = $(SUBDIRS)

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/configure.ac:1.6 rtems/testsuites/psxtmtests/configure.ac:1.7
--- rtems/testsuites/psxtmtests/configure.ac:1.6        Wed Jun 29 14:09:11 2011
+++ rtems/testsuites/psxtmtests/configure.ac    Tue Jul 12 08:22:24 2011
</font><font color='#997700'>@@ -80,6 +80,7 @@
</font> # Explicitly list all Makefiles here
 AC_CONFIG_FILES([Makefile
 psxtmmutex02/Makefile
<font color='#000088'>+psxtmmutex03/Makefile
</font> psxtmsleep01/Makefile
 psxtmsleep02/Makefile
 psxtmthread01/Makefile

<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmmutex03/.cvsignore:1.1
--- /dev/null   Tue Jul 12 09:10:21 2011
+++ rtems/testsuites/psxtmtests/psxtmmutex03/.cvsignore Tue Jul 12 08:22:24 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmmutex03/Makefile.am:1.1
--- /dev/null   Tue Jul 12 09:10:21 2011
+++ rtems/testsuites/psxtmtests/psxtmmutex03/Makefile.am        Tue Jul 12 08:22:24 2011
</font><font color='#997700'>@@ -0,0 +1,30 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxtmmutex03
+psxtmmutex03_SOURCES = init.c ../../tmtests/include/timesys.h \
+    ../../support/src/tmtests_empty_function.c \
+    ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = psxtmmutex03.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+OPERATION_COUNT = @OPERATION_COUNT@
+AM_CPPFLAGS += -I$(top_srcdir)/../tmtests/include
+AM_CPPFLAGS += -DOPERATION_COUNT=$(OPERATION_COUNT)
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(psxtmmutex03_OBJECTS) $(psxtmmutex03_LDADD)
+LINK_LIBS = $(psxtmmutex03_LDLIBS)
+
+psxtmmutex03$(EXEEXT): $(psxtmmutex03_OBJECTS) $(psxtmmutex03_DEPENDENCIES)
+       @rm -f psxtmmutex03$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmmutex03/init.c:1.1
--- /dev/null   Tue Jul 12 09:10:21 2011
+++ rtems/testsuites/psxtmtests/psxtmmutex03/init.c     Tue Jul 12 08:22:24 2011
</font><font color='#997700'>@@ -0,0 +1,175 @@
</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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <timesys.h>
+#include <rtems/timerdrv.h>
+#include <errno.h>
+#include <pthread.h>
+#include "test_support.h"
+
+pthread_mutex_t MutexId;
+
+void benchmark_mutex_lock_available(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = pthread_mutex_lock( &MutexId );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( !status );
+
+  put_time(
+    "pthread_mutex_lock - available",
+    end_time,
+    1,
+    0,
+    0
+  );
+}
+
+void benchmark_mutex_unlock_no_threads_waiting(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = pthread_mutex_unlock( &MutexId );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( !status );
+
+  put_time(
+    "pthread_mutex_unlock - no threads waiting",
+    end_time,
+    1,
+    0,
+    0
+  );
+}
+
+void benchmark_mutex_trylock_available(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = pthread_mutex_trylock( &MutexId );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( !status );
+
+  put_time(
+    "pthread_mutex_trylock - available",
+    end_time,
+    1,
+    0,
+    0
+  );
+}
+
+
+void benchmark_mutex_trylock_not_available(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = pthread_mutex_trylock( &MutexId );
+    /*<span style="background-color: #FF0000"> </span>
+     * it has to return a negative value<span style="background-color: #FF0000"> </span>
+     * because it try to lock a not available mutex<span style="background-color: #FF0000">    </span>
+     * so the assert call is make with status instead !status<span style="background-color: #FF0000"> </span>
+     */
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status );
+
+  put_time(
+    "pthread_mutex_trylock - not available",
+    end_time,
+    1,
+    0,
+    0
+  );
+}
+
+void benchmark_mutex_timedlock_available(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = pthread_mutex_timedlock( &MutexId, 0 );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( !status );
+
+  put_time(
+    "pthread_mutex_timedlock - available",
+    end_time,
+    1,
+    0,
+    0
+  );
+}
+
+void *POSIX_Init(
+  void *argument
+)
+{
+  int  status;
+
+  puts( "\n\n*** POSIX TIME TEST PSXTMMUTEX03 ***" );
+<span style="background-color: #FF0000">  </span>
+  /*
+   * Create the single Mutex used in all the test case
+   */
+  status = pthread_mutex_init( &MutexId, NULL );
+  rtems_test_assert( !status );
+
+  /*
+   * Now invoke subroutines to time each test case<span style="background-color: #FF0000"> </span>
+   * get the goal depends of its order
+   */
+  benchmark_mutex_lock_available();
+  benchmark_mutex_unlock_no_threads_waiting();
+  benchmark_mutex_trylock_available();
+  benchmark_mutex_trylock_not_available();
+  benchmark_mutex_unlock_no_threads_waiting();
+  benchmark_mutex_timedlock_available();
+  benchmark_mutex_unlock_no_threads_waiting();
+<span style="background-color: #FF0000">  </span>
+
+  /*
+   *  Destroy the mutex used in the tests
+   */
+  status = pthread_mutex_destroy( &MutexId );
+  rtems_test_assert( !status );
+
+  puts( "*** END OF POSIX TIME TEST PSXTMMUTEX03 ***" );
+
+  rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS     1
+#define CONFIGURE_MAXIMUM_POSIX_MUTEXES     1
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmmutex03/psxtmmutex03.doc:1.1
--- /dev/null   Tue Jul 12 09:10:21 2011
+++ rtems/testsuites/psxtmtests/psxtmmutex03/psxtmmutex03.doc   Tue Jul 12 08:22:24 2011
</font><font color='#997700'>@@ -0,0 +1,20 @@
</font><font color='#000088'>+#
+#  $Id$
+#
+#  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.
+#
+
+This test benchmarks the following operations:
+
++ pthread_mutex_lock - available<span style="background-color: #FF0000"> </span>
++ pthread_mutex_unlock - no threads waiting<span style="background-color: #FF0000"> </span>
++ pthread_mutex_trylock - available<span style="background-color: #FF0000"> </span>
++ pthread_mutex_trylock - not available<span style="background-color: #FF0000"> </span>
++ pthread_mutex_unlock - no threads waiting<span style="background-color: #FF0000"> </span>
++ pthread_mutex_timedlock - available<span style="background-color: #FF0000"> </span>
++ pthread_mutex_unlock - no threads waiting<span style="background-color: #FF0000"> </span>
</font>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.7 rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.8
--- rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.7 Wed Jun 29 14:09:11 2011
+++ rtems/testsuites/psxtmtests/psxtmtests_plan.csv     Tue Jul 12 08:22:24 2011
</font><font color='#997700'>@@ -2,13 +2,13 @@
</font> "pthread_mutex_init","psxtmmutex01","psxtmtest_init_destroy",
 "pthread_mutex_destroy","psxtmmutex01","psxtmtest_init_destroy",
 "pthread_mutex_lock - not available, block","psxtmmutex02","psxtmtest_blocking","Yes"
<font color='#880000'>-"pthread_mutex_lock - available","psxtmmutex03","psxtmtest_single",
-"pthread_mutex_trylock - available","psxtmmutex04","psxtmtest_single",
-"pthread_mutex_trylock - not available","psxtmmutex05","psxtmtest_single",
-"pthread_mutex_unlock - no threads waiting","psxtmmutex06","psxtmtest_single",
</font><font color='#000088'>+"pthread_mutex_lock - available","psxtmmutex03","psxtmtest_single","Yes"
+"pthread_mutex_trylock - available","psxtmmutex03","psxtmtest_single","Yes"
+"pthread_mutex_trylock - not available","psxtmmutex03","psxtmtest_single","Yes"
+"pthread_mutex_unlock - no threads waiting","psxtmmutex03","psxtmtest_single","Yes"
</font> "pthread_mutex_unlock - thread waiting, no preempt","psxtmmutex07","psxtmtest_unblocking_nopreempt",
 "pthread_mutex_unlock - thread waiting, preempt","psxtmmutex08","psxtmtest_unblocking_preempt",
<font color='#880000'>-"pthread_mutex_timedlock - available","psxtmmutex09","psxtmtest_single",
</font><font color='#000088'>+"pthread_mutex_timedlock - available","psxtmmutex03","psxtmtest_single","Yes"
</font> "pthread_mutex_timedlock - not available, block","psxtmmutex10","psxtmtest_blocking",
 "pthread_mutex_setprioceiling","psxtmmutex11","psxtmtest_single",
 "pthread_mutex_getprioceiling","psxtmmutex12","psxtmtest_single",
</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>2011-07-12 Joel Sherrill <joel.sherrill@oarcorp.com>

        * psxtmnanosleep01/init.c, psxtmsleep01/init.c: Do not divide by
        OPERATION_COUNT on single shot times.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/ChangeLog.diff?r1=text&tr1=1.15&r2=text&tr2=1.16&diff_format=h">M</a></td><td width='1%'>1.16</td><td width='100%'>testsuites/psxtmtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmnanosleep01/init.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>testsuites/psxtmtests/psxtmnanosleep01/init.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmsleep01/init.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>testsuites/psxtmtests/psxtmsleep01/init.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/ChangeLog:1.15 rtems/testsuites/psxtmtests/ChangeLog:1.16
--- rtems/testsuites/psxtmtests/ChangeLog:1.15  Tue Jul 12 08:22:24 2011
+++ rtems/testsuites/psxtmtests/ChangeLog       Tue Jul 12 08:25:18 2011
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2011-07-12    Joel Sherrill <joel.sherrill@oarcorp.com>
+
+       * psxtmnanosleep01/init.c, psxtmsleep01/init.c: Do not divide by
+       OPERATION_COUNT on single shot times.
+
</font> 2011-07-12        Ricardo Aguirre <el.mastin@ymail.com>
 
        * Makefile.am, configure.ac, psxtmtests_plan.csv: Add psxtmmutex03.

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/psxtmnanosleep01/init.c:1.1 rtems/testsuites/psxtmtests/psxtmnanosleep01/init.c:1.2
--- rtems/testsuites/psxtmtests/psxtmnanosleep01/init.c:1.1     Wed Jun 29 14:09:11 2011
+++ rtems/testsuites/psxtmtests/psxtmnanosleep01/init.c Tue Jul 12 08:25:18 2011
</font><font color='#997700'>@@ -23,18 +23,17 @@
</font> {
   long end_time;
   struct timespec sleepTime;
<font color='#000088'>+
</font>   sleepTime.tv_sec = 0;
   sleepTime.tv_nsec = 0;
 
   puts( "\n\n*** POSIX TIME TEST PSXTMNANOSLEEP01 ***" );
 
   benchmark_timer_initialize();<span style="background-color: #FF0000">    </span>
<font color='#880000'>-
-  nanosleep(&sleepTime, (struct  timespec *) NULL);
-
</font><font color='#000088'>+    nanosleep( &sleepTime, (struct  timespec *) NULL );
</font>   end_time = benchmark_timer_read();<span style="background-color: #FF0000">  </span>
 
<font color='#880000'>-  put_time("nanosleep - yield X ",end_time,OPERATION_COUNT,0,0);
</font><font color='#000088'>+  put_time( "nanosleep - yield", end_time, 1, 0, 0 );
</font> 
   puts( "*** END OF POSIX TIME TEST PSXTMNANOSLEEP01 ***" );
 

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/psxtmsleep01/init.c:1.1 rtems/testsuites/psxtmtests/psxtmsleep01/init.c:1.2
--- rtems/testsuites/psxtmtests/psxtmsleep01/init.c:1.1 Mon Jun 13 14:28:57 2011
+++ rtems/testsuites/psxtmtests/psxtmsleep01/init.c     Tue Jul 12 08:25:18 2011
</font><font color='#997700'>@@ -28,15 +28,13 @@
</font>   puts( "\n\n*** POSIX TIME TEST PSXTMSLEEP01 ***" );
 
   benchmark_timer_initialize();
<font color='#880000'>-
</font>     sleep(0);
<font color='#880000'>-
</font>   end_time = benchmark_timer_read();
 
   put_time(
<font color='#880000'>-    "sleep - yield X ",
</font><font color='#000088'>+    "sleep - yield",
</font>     end_time,
<font color='#880000'>-    OPERATION_COUNT,
</font><font color='#000088'>+    1,
</font>     0,
     0
   );
</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>