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 /cpukit/sapi | |
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 'cpukit/sapi')
-rw-r--r-- | cpukit/sapi/include/confdefs.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 4bfe4e88ff..a3ec7fa019 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -1591,12 +1591,21 @@ const rtems_libio_helper rtems_fs_init_helper = (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t))) #endif - /** - * This macro calculates the memory required for task variables. - * - * NOTE: Each task variable is individually allocated from the Workspace. - * Hence, we do the multiplication on the configured size. - */ +/** + * This macro calculates the memory required for task variables. + * + * Each task variable is individually allocated from the Workspace. + * Hence, we do the multiplication on the configured size. + * + * @note Per-task variables are disabled for SMP configurations. + */ +#if defined(RTEMS_SMP) + #ifdef CONFIGURE_MAXIMUM_TASK_VARIABLES + #error "Per-Task Variables are not safe for SMP systems and disabled" + #endif + #define CONFIGURE_MAXIMUM_TASK_VARIABLES 0 + #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) 0 +#else #ifndef CONFIGURE_MAXIMUM_TASK_VARIABLES #define CONFIGURE_MAXIMUM_TASK_VARIABLES 0 #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) 0 @@ -1605,6 +1614,7 @@ const rtems_libio_helper rtems_fs_init_helper = (_task_variables) * \ _Configure_From_workspace(sizeof(rtems_task_variable_t)) #endif +#endif #ifndef CONFIGURE_MAXIMUM_TIMERS #define CONFIGURE_MAXIMUM_TIMERS 0 |