<!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-26)</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-26 Ricardo Aguirre <el.mastin@ymail.com>

        PR 1849/tests
        * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
        sem_post - thread waiting, no preempt.
        * psxtmsem04/.cvsignore, psxtmsem04/Makefile.am, psxtmsem04/init.c,
        psxtmsem04/psxtmsem04.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.31&r2=text&tr2=1.32&diff_format=h">M</a></td><td width='1%'>1.32</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.14&r2=text&tr2=1.15&diff_format=h">M</a></td><td width='1%'>1.15</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.17&r2=text&tr2=1.18&diff_format=h">M</a></td><td width='1%'>1.18</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/psxtmsem04/.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/psxtmsem04/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmsem04/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/psxtmsem04/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmsem04/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/psxtmsem04/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmsem04/psxtmsem04.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/psxtmsem04/psxtmsem04.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.16&r2=text&tr2=1.17&diff_format=h">M</a></td><td width='1%'>1.17</td><td width='100%'>testsuites/psxtmtests/psxtmtests_plan.csv</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/ChangeLog:1.31 rtems/testsuites/psxtmtests/ChangeLog:1.32
--- rtems/testsuites/psxtmtests/ChangeLog:1.31  Fri Jul 22 15:22:30 2011
+++ rtems/testsuites/psxtmtests/ChangeLog       Tue Jul 26 08:33:49 2011
</font><font color='#997700'>@@ -1,3 +1,11 @@
</font><font color='#000088'>+2011-07-26    Ricardo Aguirre <el.mastin@ymail.com>
+
+       PR 1849/tests
+       * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
+       sem_post - thread waiting, no preempt.
+       * psxtmsem04/.cvsignore, psxtmsem04/Makefile.am, psxtmsem04/init.c,
+       psxtmsem04/psxtmsem04.doc: New files.
+
</font> 2011-07-22        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * psxtmthread03/psxtmthread03.doc: Fix.

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/Makefile.am:1.14 rtems/testsuites/psxtmtests/Makefile.am:1.15
--- rtems/testsuites/psxtmtests/Makefile.am:1.14        Fri Jul 22 12:22:10 2011
+++ rtems/testsuites/psxtmtests/Makefile.am     Tue Jul 26 08:33:49 2011
</font><font color='#997700'>@@ -20,6 +20,7 @@
</font> SUBDIRS += psxtmnanosleep02
 SUBDIRS += psxtmsem01
 SUBDIRS += psxtmsem02
<font color='#000088'>+SUBDIRS += psxtmsem04
</font> SUBDIRS += psxtmsleep01
 SUBDIRS += psxtmsleep02
 SUBDIRS += psxtmthread01

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/configure.ac:1.17 rtems/testsuites/psxtmtests/configure.ac:1.18
--- rtems/testsuites/psxtmtests/configure.ac:1.17       Fri Jul 22 12:22:10 2011
+++ rtems/testsuites/psxtmtests/configure.ac    Tue Jul 26 08:33:49 2011
</font><font color='#997700'>@@ -92,6 +92,7 @@
</font> psxtmnanosleep02/Makefile
 psxtmsem01/Makefile
 psxtmsem02/Makefile
<font color='#000088'>+psxtmsem04/Makefile
</font> psxtmsleep01/Makefile
 psxtmsleep02/Makefile
 psxtmthread01/Makefile

<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmsem04/.cvsignore:1.1
--- /dev/null   Tue Jul 26 09:11:20 2011
+++ rtems/testsuites/psxtmtests/psxtmsem04/.cvsignore   Tue Jul 26 08:33:50 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/psxtmsem04/Makefile.am:1.1
--- /dev/null   Tue Jul 26 09:11:20 2011
+++ rtems/testsuites/psxtmtests/psxtmsem04/Makefile.am  Tue Jul 26 08:33:50 2011
</font><font color='#997700'>@@ -0,0 +1,30 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxtmsem04
+psxtmsem04_SOURCES = init.c ../../tmtests/include/timesys.h \
+    ../../support/src/tmtests_empty_function.c \
+    ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = psxtmsem04.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 = $(psxtmsem04_OBJECTS) $(psxtmsem04_LDADD)
+LINK_LIBS = $(psxtmsem04_LDLIBS)
+
+psxtmsem04$(EXEEXT): $(psxtmsem04_OBJECTS) $(psxtmsem04_DEPENDENCIES)
+       @rm -f psxtmsem04$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmsem04/init.c:1.1
--- /dev/null   Tue Jul 26 09:11:20 2011
+++ rtems/testsuites/psxtmtests/psxtmsem04/init.c       Tue Jul 26 08:33:50 2011
</font><font color='#997700'>@@ -0,0 +1,104 @@
</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 <errno.h>
+#include <fcntl.h>
+#include <semaphore.h>
+#include <coverhd.h>
+#include <tmacros.h>
+#include <timesys.h>
+#include "test_support.h"
+#include <pthread.h>
+#include <sched.h>
+#include <rtems/timerdrv.h>
+
+#define MAX_SEMS  2
+
+sem_t           sem1;
+sem_t           *n_sem1;
+
+void *Blocker( void *argument)
+{
+  (void) sem_wait(&sem1);
+  /* should never return */
+  rtems_test_assert( FALSE );
+
+  return NULL;
+}
+
+void *POSIX_Init(void *argument)
+{
+  int        status;
+  pthread_t  threadId;
+  long       end_time;
+
+  puts( "\n\n*** POSIX TIME TEST SEMAPHORE 04 ***" );
+
+  status = pthread_create( &threadId, NULL, Blocker, NULL );
+  rtems_test_assert( status == 0 );
+<span style="background-color: #FF0000">  </span>
+  /*
+   * Deliberately create the semaphore after the threads.  This way if the
+   * threads do run before we intend, they will get an error.
+   */
+  status = sem_init( &sem1, 0, 1 );
+  rtems_test_assert( status == 0 );
+
+  /*
+   * Ensure the semaphore is unavailable so the other threads block.
+   * Lock semaphore resource to ensure thread blocks.
+   */
+  status = sem_wait(&sem1);
+  rtems_test_assert( status == 0 );
+
+  /*
+   * Let the other thread start so the thread startup overhead,
+   * is accounted for.  When we return, we can start the benchmark.
+   */
+  sched_yield();
+    /* let other thread run */
+
+  benchmark_timer_initialize();
+    status = sem_post( &sem1 ); /* semaphore unblocking operation */
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status == 0 );
+
+  put_time(
+    "sem_post - thread waiting, no preempt",
+    end_time,
+    1,
+    0,
+    0
+  );
+
+  puts( "*** END OF POSIX TIME TEST SEMAPHORE 04 ***" );
+  rtems_test_exit( 0 );
+
+  return NULL;
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS     2
+#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES  MAX_SEMS
+#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/psxtmsem04/psxtmsem04.doc:1.1
--- /dev/null   Tue Jul 26 09:11:20 2011
+++ rtems/testsuites/psxtmtests/psxtmsem04/psxtmsem04.doc       Tue Jul 26 08:33:50 2011
</font><font color='#997700'>@@ -0,0 +1,14 @@
</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:
+
++ sem_post - thread waiting, no preempt
</font>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.16 rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.17
--- rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.16        Fri Jul 22 12:22:10 2011
+++ rtems/testsuites/psxtmtests/psxtmtests_plan.csv     Tue Jul 26 08:33:49 2011
</font><font color='#997700'>@@ -27,12 +27,12 @@
</font> "pthread_join","psxtmthread03",,
 "pthread_detach",,,
 "pthread_exit",,,
<font color='#880000'>-"pthread_self",,,
-"pthread_equal",,,
-"pthread_getschedparam",,,
-"pthread_setschedparam - no thread switch",,,
-"pthread_setschedparam - lower own priority, preempt",,,
-"pthread_setschedparam - raise other priority, preempt",,,
</font><font color='#000088'>+"pthread_self",,"psxtmtest_single",
+"pthread_equal",,"psxtmtest_single",
+"pthread_getschedparam",,"psxtmtest_single",
+"pthread_setschedparam - no thread switch",,"psxtmtest_single",
+"pthread_setschedparam - lower own priority, preempt",,"psxtmtest_single",
+"pthread_setschedparam - raise other priority, preempt",,"psxtmtest_single",
</font> ,,,
 "pthread_once",,,
 ,,,
<font color='#997700'>@@ -52,9 +52,9 @@
</font> ,,,
 "pthread_barrier_init","psxtmbarrier01","psxtmtest_init_destroy",
 "pthread_barrier_destroy","psxtmbarrier01","psxtmtest_init_destroy",
<font color='#880000'>-"pthread_barrier_wait – blocking","psxtmbarrier02","psxtmtest_blocking",
-"pthread_barrier_wait – releasing, no preempt","psxtmbarrier03","psxtmtest_unblocking_nopreempt",
-"pthread_barrier_wait – releasing, preempt","psxtmbarrier04","psxtmtest_unblocking_preempt",
</font><font color='#000088'>+"pthread_barrier_wait - blocking","psxtmbarrier02","psxtmtest_blocking",
+"pthread_barrier_wait - releasing, no preempt","psxtmbarrier03","psxtmtest_unblocking_nopreempt",
+"pthread_barrier_wait - releasing, preempt","psxtmbarrier04","psxtmtest_unblocking_preempt",
</font> ,,,
 "pthread_spin_init",,"psxtmtest_init_destroy",
 "pthread_spin_destroy",,"psxtmtest_init_destroy",
<font color='#997700'>@@ -81,11 +81,11 @@
</font> "pthread_rwlock_timedwrlock - available",,"psxtmtest_single",
 "pthread_rwlock_timedwrlock - not available, blocks",,"psxtmtest_blocking",
 ,,,
<font color='#880000'>-"mq_open (first open)","psxtmsem02","psxtmtest_init_destroy",
-"mq_close (close of first)","psxtmsem02","psxtmtest_init_destroy",
-"mq_open (second open)","psxtmsem03","psxtmtest_init_destroy",
-"mq_close (close of second)","psxtmsem03","psxtmtest_init_destroy",
-"mq_unlink",,,
</font><font color='#000088'>+"mq_open (first open)","psxtmmq01","psxtmtest_init_destroy",
+"mq_close (close of first)","psxtmmq01","psxtmtest_init_destroy",
+"mq_open (second open)","psxtmmq01","psxtmtest_init_destroy",
+"mq_close (close of second)","psxtmmq01","psxtmtest_init_destroy",
+"mq_unlink","psxtmmq01","psxtmtest_init_destroy",
</font> "mq_receive - available",,"psxtmtest_single",
 "mq_receive - not available, block",,"psxtmtest_blocking",
 "mq_timedreceive - available",,"psxtmtest_single",
<font color='#997700'>@@ -111,7 +111,7 @@
</font> "sem_trywait - available","psxtmsem02","psxtmtest_single","Yes"
 "sem_trywait - not available","psxtmsem02","psxtmtest_single","Yes"
 "sem_post - no threads waiting","psxtmsem02","psxtmtest_single","Yes"
<font color='#880000'>-"sem_post - thread waiting, no preempt",,"psxtmtest_unblocking_nopreempt",
</font><font color='#000088'>+"sem_post - thread waiting, no preempt","psxsemtm04","psxtmtest_unblocking_nopreempt","Yes"
</font> "sem_post - thread waiting, preempt",,"psxtmtest_unblocking_preempt",
 "sem_getvalue","psxtmsem02","psxtmtest_single","Yes"
 ,,,
</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-26 Ricardo Aguirre <el.mastin@ymail.com>

        PR 1850/tests
        * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
        sem_post - thread waiting, preempt.
        * psxtmsem05/.cvsignore, psxtmsem05/Makefile.am, psxtmsem05/init.c,
        psxtmsem05/psxtmsem05.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.32&r2=text&tr2=1.33&diff_format=h">M</a></td><td width='1%'>1.33</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.15&r2=text&tr2=1.16&diff_format=h">M</a></td><td width='1%'>1.16</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.18&r2=text&tr2=1.19&diff_format=h">M</a></td><td width='1%'>1.19</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/psxtmsem05/.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/psxtmsem05/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmsem05/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/psxtmsem05/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmsem05/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/psxtmsem05/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmsem05/psxtmsem05.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/psxtmsem05/psxtmsem05.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.17&r2=text&tr2=1.18&diff_format=h">M</a></td><td width='1%'>1.18</td><td width='100%'>testsuites/psxtmtests/psxtmtests_plan.csv</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/ChangeLog:1.32 rtems/testsuites/psxtmtests/ChangeLog:1.33
--- rtems/testsuites/psxtmtests/ChangeLog:1.32  Tue Jul 26 08:33:49 2011
+++ rtems/testsuites/psxtmtests/ChangeLog       Tue Jul 26 08:38:42 2011
</font><font color='#997700'>@@ -1,5 +1,13 @@
</font> 2011-07-26        Ricardo Aguirre <el.mastin@ymail.com>
 
<font color='#000088'>+   PR 1850/tests
+       * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
+       sem_post - thread waiting, preempt.
+       * psxtmsem05/.cvsignore, psxtmsem05/Makefile.am, psxtmsem05/init.c,
+       psxtmsem05/psxtmsem05.doc: New files.
+
+2011-07-26     Ricardo Aguirre <el.mastin@ymail.com>
+
</font>   PR 1849/tests
        * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
        sem_post - thread waiting, no preempt.

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/Makefile.am:1.15 rtems/testsuites/psxtmtests/Makefile.am:1.16
--- rtems/testsuites/psxtmtests/Makefile.am:1.15        Tue Jul 26 08:33:49 2011
+++ rtems/testsuites/psxtmtests/Makefile.am     Tue Jul 26 08:38:42 2011
</font><font color='#997700'>@@ -21,6 +21,7 @@
</font> SUBDIRS += psxtmsem01
 SUBDIRS += psxtmsem02
 SUBDIRS += psxtmsem04
<font color='#000088'>+SUBDIRS += psxtmsem05
</font> SUBDIRS += psxtmsleep01
 SUBDIRS += psxtmsleep02
 SUBDIRS += psxtmthread01

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/configure.ac:1.18 rtems/testsuites/psxtmtests/configure.ac:1.19
--- rtems/testsuites/psxtmtests/configure.ac:1.18       Tue Jul 26 08:33:49 2011
+++ rtems/testsuites/psxtmtests/configure.ac    Tue Jul 26 08:38:42 2011
</font><font color='#997700'>@@ -93,6 +93,7 @@
</font> psxtmsem01/Makefile
 psxtmsem02/Makefile
 psxtmsem04/Makefile
<font color='#000088'>+psxtmsem05/Makefile
</font> psxtmsleep01/Makefile
 psxtmsleep02/Makefile
 psxtmthread01/Makefile

<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmsem05/.cvsignore:1.1
--- /dev/null   Tue Jul 26 09:11:20 2011
+++ rtems/testsuites/psxtmtests/psxtmsem05/.cvsignore   Tue Jul 26 08:38:42 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/psxtmsem05/Makefile.am:1.1
--- /dev/null   Tue Jul 26 09:11:20 2011
+++ rtems/testsuites/psxtmtests/psxtmsem05/Makefile.am  Tue Jul 26 08:38:42 2011
</font><font color='#997700'>@@ -0,0 +1,30 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxtmsem05
+psxtmsem05_SOURCES = init.c ../../tmtests/include/timesys.h \
+    ../../support/src/tmtests_empty_function.c \
+    ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = psxtmsem05.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 = $(psxtmsem05_OBJECTS) $(psxtmsem05_LDADD)
+LINK_LIBS = $(psxtmsem05_LDLIBS)
+
+psxtmsem05$(EXEEXT): $(psxtmsem05_OBJECTS) $(psxtmsem05_DEPENDENCIES)
+       @rm -f psxtmsem05$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmsem05/init.c:1.1
--- /dev/null   Tue Jul 26 09:11:20 2011
+++ rtems/testsuites/psxtmtests/psxtmsem05/init.c       Tue Jul 26 08:38:42 2011
</font><font color='#997700'>@@ -0,0 +1,163 @@
</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 <errno.h>
+#include <fcntl.h>
+#include <semaphore.h>
+#include <coverhd.h>
+#include <tmacros.h>
+#include <timesys.h>
+#include "test_support.h"
+#include <pthread.h>
+#include <sched.h>
+#include <rtems/timerdrv.h>
+
+#define MAX_SEMS  2
+
+sem_t   sem1;
+
+void *Low(
+  void *argument
+)
+{
+  int      status;
+  uint32_t end_time;
+
+    status = sem_wait(&sem1); /* semaphore blocks */
+  end_time = benchmark_timer_read();
+
+  rtems_test_assert( status == 0 );
+
+  put_time(
+    "sem_post - thread waiting, preempt",
+    end_time,
+    OPERATION_COUNT,
+    0,
+    0
+  );
+
+  puts( "*** END OF POSIX TIME TEST PSXTMSEM05 ***" );
+  rtems_test_exit( 0 );
+  return NULL;
+}
+
+void *Middle(
+  void *argument
+)
+{
+  int status;
+
+    status = sem_wait(&sem1); /* semaphore blocks */
+  rtems_test_assert( status == 0 );
+
+    /* thread switch occurs */
+
+    status = sem_post(&sem1);
+  rtems_test_assert( status == 0 );
+
+    /* thread switch occurs */
+
+  /* should never return */
+  rtems_test_assert( FALSE );
+  return NULL;
+}
+
+void *POSIX_Init(
+  void *argument
+)
+{
+  int                 i;
+  int                 status;
+  pthread_t           threadId;
+  pthread_attr_t      attr;
+  struct sched_param  param;
+
+  puts( "\n\n*** POSIX TIME TEST PSXTMSEM05  ***" );
+
+  /*
+   * Deliberately create the semaphore BEFORE the threads.  This way the
+   * threads should preempt this thread and block as they are created.
+   */
+  status = sem_init( &sem1, 0, 1 );
+  rtems_test_assert( status == 0 );
+
+  /*
+   * Obtain the semaphore so the threads will block.
+   */
+  status = sem_wait( &sem1 );
+  rtems_test_assert( status == 0 );
+
+  /*
+   * Now lower our priority
+   */
+  status = pthread_attr_init( &attr );
+  rtems_test_assert( status == 0 );
+
+  status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
+  rtems_test_assert( status == 0 );
+
+  status = pthread_attr_setschedpolicy( &attr, SCHED_RR );
+  rtems_test_assert( status == 0 );
+
+  param.sched_priority = 2;
+  status = pthread_attr_setschedparam( &attr, &param );
+  rtems_test_assert( status == 0 );
+
+  /*
+   * And create rest of threads as more important than we are.  They
+   * will preempt us as they are created and block.
+   */
+  for ( i=0 ; i < OPERATION_COUNT ; i++ ) {
+
+    param.sched_priority = 3 + i;
+    status = pthread_attr_setschedparam( &attr, &param );
+    rtems_test_assert( status == 0 );
+
+    status = pthread_create(
+      &threadId,
+      &attr,
+      (i == OPERATION_COUNT - 1) ? Low : Middle,
+      NULL
+    );
+    rtems_test_assert( status == 0 );
+  }
+<span style="background-color: #FF0000">  </span>
+  /*
+   * Now start the timer which will be stopped in Low.
+   * Release the semaphore so threads unblock and preempt.
+   */
+  benchmark_timer_initialize();
+
+    status = sem_post( &sem1 );
+      /* thread switch occurs */
+
+  /* should never return */
+  rtems_test_assert( FALSE );
+  return NULL;
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS     OPERATION_COUNT + 2
+#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES  MAX_SEMS
+#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/psxtmsem05/psxtmsem05.doc:1.1
--- /dev/null   Tue Jul 26 09:11:21 2011
+++ rtems/testsuites/psxtmtests/psxtmsem05/psxtmsem05.doc       Tue Jul 26 08:38:42 2011
</font><font color='#997700'>@@ -0,0 +1,14 @@
</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:
+
++ sem_post - thread waiting, preempt
</font>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.17 rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.18
--- rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.17        Tue Jul 26 08:33:49 2011
+++ rtems/testsuites/psxtmtests/psxtmtests_plan.csv     Tue Jul 26 08:38:42 2011
</font><font color='#997700'>@@ -112,7 +112,7 @@
</font> "sem_trywait - not available","psxtmsem02","psxtmtest_single","Yes"
 "sem_post - no threads waiting","psxtmsem02","psxtmtest_single","Yes"
 "sem_post - thread waiting, no preempt","psxsemtm04","psxtmtest_unblocking_nopreempt","Yes"
<font color='#880000'>-"sem_post - thread waiting, preempt",,"psxtmtest_unblocking_preempt",
</font><font color='#000088'>+"sem_post - thread waiting, preempt","psxtmsem05","psxtmtest_unblocking_preempt",
</font> "sem_getvalue","psxtmsem02","psxtmtest_single","Yes"
 ,,,
 "sleep - yield","psxtmsleep01","psxtmtest_single","Yes"
</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>