summaryrefslogtreecommitdiffstats
path: root/testsuites/tmtests/tm30/init.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-21 16:53:50 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-06-21 16:53:50 +0000
commitf63801a25209817f751e4139c92ca9eb7bd35f05 (patch)
tree67206c4d723682dc0f0a4f05ef9a267d30f1fdcc /testsuites/tmtests/tm30/init.c
parent2010-06-21 Peter Dufault <dufault@hda.com> (diff)
downloadrtems-f63801a25209817f751e4139c92ca9eb7bd35f05.tar.bz2
2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: New test for barrier create, ident, and delete. * tm30/.cvsignore, tm30/Makefile.am, tm30/init.c, tm30/tm30.doc: New files.
Diffstat (limited to 'testsuites/tmtests/tm30/init.c')
-rw-r--r--testsuites/tmtests/tm30/init.c106
1 files changed, 106 insertions, 0 deletions
diff --git a/testsuites/tmtests/tm30/init.c b/testsuites/tmtests/tm30/init.c
new file mode 100644
index 0000000000..d27e030442
--- /dev/null
+++ b/testsuites/tmtests/tm30/init.c
@@ -0,0 +1,106 @@
+/*
+ * COPYRIGHT (c) 1989-2010.
+ * 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$
+ */
+
+#include <bsp.h>
+#include <coverhd.h>
+#include <tmacros.h>
+#include <timesys.h>
+#include "test_support.h"
+
+rtems_id barrier[ OPERATION_COUNT ];
+
+void benchmark_barrier_create(
+ int iteration,
+ void *argument
+)
+{
+ rtems_status_code status;
+
+ status = rtems_barrier_create(
+ iteration + 1,
+ RTEMS_LOCAL | RTEMS_FIFO,
+ 2,
+ &barrier[iteration]
+ );
+ directive_failed(status, "rtems_barrier_create");
+}
+
+void benchmark_barrier_ident(
+ int iteration,
+ void *argument
+)
+{
+ rtems_status_code status;
+ rtems_id id;
+
+ status = rtems_barrier_ident( iteration+1, &id );
+ directive_failed(status, "rtems_barrier_ident");
+}
+
+void benchmark_barrier_delete(
+ int iteration,
+ void *argument
+)
+{
+ rtems_status_code status;
+
+ status = rtems_barrier_delete( barrier[iteration] );
+ directive_failed(status, "rtems_barrier_delete");
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ puts( "\n\n*** TIME TEST 30 ***" );
+
+ rtems_time_test_measure_operation(
+ "rtems_barrier_create",
+ benchmark_barrier_create,
+ NULL,
+ OPERATION_COUNT,
+ 0
+ );
+
+ rtems_time_test_measure_operation(
+ "rtems_barrier_ident",
+ benchmark_barrier_ident,
+ NULL,
+ OPERATION_COUNT,
+ 0
+ );
+
+ rtems_time_test_measure_operation(
+ "rtems_barrier_delete",
+ benchmark_barrier_delete,
+ NULL,
+ OPERATION_COUNT,
+ 0
+ );
+
+ puts( "*** END OF TIME TEST 30 ***" );
+
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MAXIMUM_BARRIERS OPERATION_COUNT
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */