summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-18 11:27:39 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-22 16:46:01 +0200
commitf913c796ffed8fe19e37f9a4dc914f6dca68baa2 (patch)
treee2206e3529d92283f701c1bdfba4f7b7c1422d47 /testsuites
parentscore: Add and use _ISR_Get_nest_level() (diff)
downloadrtems-f913c796ffed8fe19e37f9a4dc914f6dca68baa2.tar.bz2
sapi: Add rtems_configuration_is_smp_enabled()
Add a configuration field which indicates if the SMP mode of operation is enabled. This can be used to disable features unsupported on SMP, e.g task variables.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/smptests/Makefile.am1
-rw-r--r--testsuites/smptests/configure.ac1
-rw-r--r--testsuites/smptests/smpunsupported01/Makefile.am19
-rw-r--r--testsuites/smptests/smpunsupported01/init.c50
-rw-r--r--testsuites/smptests/smpunsupported01/smpunsupported01.doc11
-rw-r--r--testsuites/smptests/smpunsupported01/smpunsupported01.scn2
6 files changed, 84 insertions, 0 deletions
diff --git a/testsuites/smptests/Makefile.am b/testsuites/smptests/Makefile.am
index 86991678a7..6760432ed0 100644
--- a/testsuites/smptests/Makefile.am
+++ b/testsuites/smptests/Makefile.am
@@ -21,6 +21,7 @@ SUBDIRS += smpatomic06
SUBDIRS += smpatomic07
SUBDIRS += smplock01
SUBDIRS += smpschedule01
+SUBDIRS += smpunsupported01
endif
include $(top_srcdir)/../automake/subdirs.am
diff --git a/testsuites/smptests/configure.ac b/testsuites/smptests/configure.ac
index 19e1effb41..9d7a6cab7b 100644
--- a/testsuites/smptests/configure.ac
+++ b/testsuites/smptests/configure.ac
@@ -54,5 +54,6 @@ smpatomic06/Makefile
smpatomic07/Makefile
smplock01/Makefile
smpschedule01/Makefile
+smpunsupported01/Makefile
])
AC_OUTPUT
diff --git a/testsuites/smptests/smpunsupported01/Makefile.am b/testsuites/smptests/smpunsupported01/Makefile.am
new file mode 100644
index 0000000000..6f1826c24c
--- /dev/null
+++ b/testsuites/smptests/smpunsupported01/Makefile.am
@@ -0,0 +1,19 @@
+rtems_tests_PROGRAMS = smpunsupported01
+smpunsupported01_SOURCES = init.c
+
+dist_rtems_tests_DATA = smpunsupported01.scn smpunsupported01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(smpunsupported01_OBJECTS)
+LINK_LIBS = $(smpunsupported01_LDLIBS)
+
+smpunsupported01$(EXEEXT): $(smpunsupported01_OBJECTS) $(smpunsupported01_DEPENDENCIES)
+ @rm -f smpunsupported01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/smptests/smpunsupported01/init.c b/testsuites/smptests/smpunsupported01/init.c
new file mode 100644
index 0000000000..0f1a1023a0
--- /dev/null
+++ b/testsuites/smptests/smpunsupported01/init.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include "tmacros.h"
+
+static void test(void)
+{
+ rtems_test_assert(rtems_configuration_is_smp_enabled());
+}
+
+static void Init(rtems_task_argument arg)
+{
+ puts("\n\n*** TEST SMPUNSUPPORTED 1 ***");
+
+ test();
+
+ puts("*** END OF TEST SMPUNSUPPORTED 1 ***");
+
+ rtems_test_exit(0);
+}
+
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_SMP_APPLICATION
+
+#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 1
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
diff --git a/testsuites/smptests/smpunsupported01/smpunsupported01.doc b/testsuites/smptests/smpunsupported01/smpunsupported01.doc
new file mode 100644
index 0000000000..954bf300c4
--- /dev/null
+++ b/testsuites/smptests/smpunsupported01/smpunsupported01.doc
@@ -0,0 +1,11 @@
+This file describes the directives and concepts tested by this test set.
+
+test set name: smpunsupported01
+
+directives:
+
+ - rtems_configuration_is_smp_enabled()
+
+concepts:
+
+ - Ensure that functions unsupported on SMP return an error status.
diff --git a/testsuites/smptests/smpunsupported01/smpunsupported01.scn b/testsuites/smptests/smpunsupported01/smpunsupported01.scn
new file mode 100644
index 0000000000..a4ced68747
--- /dev/null
+++ b/testsuites/smptests/smpunsupported01/smpunsupported01.scn
@@ -0,0 +1,2 @@
+*** TEST SMPUNSUPPORTED 1 ***
+*** END OF TEST SMPUNSUPPORTED 1 ***