diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-04-03 12:55:43 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-04-04 14:27:27 -0500 |
commit | d507c0373168e6375b1e876d79730bff8020cb58 (patch) | |
tree | 1ca65b27019e70bdeef2e7d01357cfdbae2a0d5b /testsuites | |
parent | rhealstone/rhmlatency: Fix configuration (diff) | |
download | rtems-d507c0373168e6375b1e876d79730bff8020cb58.tar.bz2 |
Disable per task variables when SMP is enabled
Per task variables are inherently unsafe in SMP systems. This
patch disables them from the build and adds warnings in the
appropriate documentation and configuration sections.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/psxtests/psxconfig01/init.c | 13 | ||||
-rw-r--r-- | testsuites/smptests/smpunsupported01/init.c | 10 | ||||
-rw-r--r-- | testsuites/sptests/Makefile.am | 7 | ||||
-rw-r--r-- | testsuites/sptests/configure.ac | 4 |
4 files changed, 22 insertions, 12 deletions
diff --git a/testsuites/psxtests/psxconfig01/init.c b/testsuites/psxtests/psxconfig01/init.c index b090fe7337..afce9f6c5f 100644 --- a/testsuites/psxtests/psxconfig01/init.c +++ b/testsuites/psxtests/psxconfig01/init.c @@ -7,6 +7,7 @@ */ /* + * Copyright (c) 2014. On-Line Applications Research Corporation (OAR). * Copyright (c) 2011-2012 embedded brains GmbH. All rights reserved. * * embedded brains GmbH @@ -51,7 +52,9 @@ const char rtems_test_name[] = "PSXCONFIG 1"; #define CONFIGURE_MAXIMUM_REGIONS 43 #define CONFIGURE_MAXIMUM_SEMAPHORES 47 #define CONFIGURE_MAXIMUM_TASKS 11 -#define CONFIGURE_MAXIMUM_TASK_VARIABLES 13 +#if !defined(RTEMS_SMP) + #define CONFIGURE_MAXIMUM_TASK_VARIABLES 13 +#endif #define CONFIGURE_MAXIMUM_TIMERS 59 #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 17 @@ -196,7 +199,9 @@ typedef struct { static char posix_name [NAME_MAX]; -static void *task_var; +#if !defined(RTEMS_SMP) + static void *task_var; +#endif static char *get_posix_name(char a, char b, char c, int i) { @@ -208,10 +213,12 @@ static char *get_posix_name(char a, char b, char c, int i) return posix_name; } +#if !defined(RTEMS_SMP) static void task_var_dtor(void *var __attribute__((unused))) { /* Do nothing */ } +#endif static void *posix_thread(void *arg __attribute__((unused))) { @@ -403,12 +410,14 @@ static rtems_task Init(rtems_task_argument argument) ); #endif +#if !defined(RTEMS_SMP) #ifdef CONFIGURE_MAXIMUM_TASK_VARIABLES for (i = 0; i < CONFIGURE_MAXIMUM_TASK_VARIABLES; ++i) { sc = rtems_task_variable_add(RTEMS_SELF, &task_var, task_var_dtor); directive_failed(sc, "rtems_task_variable_add"); } #endif +#endif #ifdef CONFIGURE_MAXIMUM_TIMERS for (i = 0; i < CONFIGURE_MAXIMUM_TIMERS; ++i) { diff --git a/testsuites/smptests/smpunsupported01/init.c b/testsuites/smptests/smpunsupported01/init.c index 3a819b8f79..9d69b6bdc6 100644 --- a/testsuites/smptests/smpunsupported01/init.c +++ b/testsuites/smptests/smpunsupported01/init.c @@ -1,4 +1,5 @@ /* + * Copyright (c) 2014 On-Line Applications Research Corporation (OAR). * Copyright (c) 2013-2014 embedded brains GmbH. All rights reserved. * * embedded brains GmbH @@ -28,15 +29,6 @@ static void test(void) rtems_test_assert(rtems_configuration_is_smp_enabled()); - sc = rtems_task_variable_add(RTEMS_SELF, NULL, NULL); - rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED); - - sc = rtems_task_variable_delete(RTEMS_SELF, NULL); - rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED); - - sc = rtems_task_variable_get(RTEMS_SELF, NULL, NULL); - rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED); - sc = rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &mode); rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED); diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am index c344ce01e2..1d530e2654 100644 --- a/testsuites/sptests/Makefile.am +++ b/testsuites/sptests/Makefile.am @@ -5,7 +5,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal SUBDIRS = \ sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 \ sp10 sp11 sp12 sp13 sp14 sp15 sp16 sp17 sp18 sp19 \ - sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp27a sp28 sp29 \ + sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp27a \ sp30 sp31 sp32 sp33 sp34 sp35 sp37 sp38 sp39 \ sp40 sp41 sp42 sp43 sp44 sp45 sp46 sp47 sp48 sp49 \ sp50 sp51 sp52 sp53 sp54 sp55 sp56 sp57 sp58 sp59 \ @@ -33,6 +33,11 @@ SUBDIRS = \ spsignal_err01 spport_err01 spmsgq_err01 spmsgq_err02 spsem_err01 \ spsem_err02 sptask_err01 spevent_err03 sptask_err03 sptask_err02 \ sptask_err04 spclock_err01 +if HAS_SMP +else +SUBDIRS += sp29 +endif + SUBDIRS += spprofiling01 SUBDIRS += spfatal28 SUBDIRS += spthreadlife01 SUBDIRS += spprofiling01 diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac index 3f2f952db2..30d2787bc7 100644 --- a/testsuites/sptests/configure.ac +++ b/testsuites/sptests/configure.ac @@ -34,6 +34,10 @@ AC_CHECK_SIZEOF([time_t]) AC_CHECK_HEADERS([sys/cpuset.h]) AM_CONDITIONAL(HAS_CPUSET,test x"${ac_cv_header_sys_cpuset_h}" = x"yes") +# Some tests should not be built/run in SMP configurations +RTEMS_CHECK_CPUOPTS([RTEMS_SMP]) +AM_CONDITIONAL(HAS_SMP,test "$rtems_cv_RTEMS_SMP" = "yes") + # Explicitly list all Makefiles here AC_CONFIG_FILES([Makefile spfatal28/Makefile |