summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp75/init.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-26 20:53:09 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-26 20:53:09 +0000
commit6b95d5c0f78010c490fe568151be29ab16dcb538 (patch)
tree468ae51df7b295f623af01e19608c8222aab27ee /testsuites/sptests/sp75/init.c
parent2011-07-26 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-6b95d5c0f78010c490fe568151be29ab16dcb538.tar.bz2
2011-07-26 Joel Sherrill <joel.sherrilL@OARcorp.com>
* Makefile.am, configure.ac: New test to get coverage of core mutex obtain while in ISR or other dispatch disabled critical section but no wait. * sp75/.cvsignore, sp75/Makefile.am, sp75/init.c, sp75/sp75.doc, sp75/sp75.scn: New files.
Diffstat (limited to 'testsuites/sptests/sp75/init.c')
-rw-r--r--testsuites/sptests/sp75/init.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/testsuites/sptests/sp75/init.c b/testsuites/sptests/sp75/init.c
new file mode 100644
index 0000000000..0ce2da2f4c
--- /dev/null
+++ b/testsuites/sptests/sp75/init.c
@@ -0,0 +1,57 @@
+/*
+ * 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$
+ */
+
+#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 1
+#include <tmacros.h>
+#include "test_support.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code sc;
+ rtems_id mutex;
+
+ puts( "\n\n*** TEST SP75 ***" );
+
+ sc = rtems_semaphore_create(
+ rtems_build_name('M', 'U', 'T', 'X'),
+ 0,
+ RTEMS_BINARY_SEMAPHORE,
+ 0,
+ &mutex
+ );
+ directive_failed(sc, "rtems_semaphore_create");
+
+ _Thread_Disable_dispatch();
+
+ sc = rtems_semaphore_obtain(mutex, RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT);
+ directive_failed(sc, "rtems_semaphore_obtain");
+
+ _Thread_Enable_dispatch();
+
+ puts( "*** END OF TEST SP75 ***" );
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */