summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/stackimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-12-07 16:50:35 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-12 09:08:36 +0100
commitfc398fde77d25c086e109403eddd6de267982653 (patch)
treeb05f699063a0095d0d732d67d894d9dcf8376c72 /cpukit/include/rtems/score/stackimpl.h
parentscore: Remove _Stack_Ensure_minimum() call (diff)
downloadrtems-fc398fde77d25c086e109403eddd6de267982653.tar.bz2
score: Simplify FP context allocation
Use the stack area to allocate the FP context. This considerably simplifies the application configuration since the task count no longer influences the configured work space size. With this change the stack space size is overestimated since an FP context for each thread is accounted. Memory constraint applications can use the stack size for fine tuning. Update #3835.
Diffstat (limited to 'cpukit/include/rtems/score/stackimpl.h')
-rw-r--r--cpukit/include/rtems/score/stackimpl.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/cpukit/include/rtems/score/stackimpl.h b/cpukit/include/rtems/score/stackimpl.h
index f4671dea60..60704534c7 100644
--- a/cpukit/include/rtems/score/stackimpl.h
+++ b/cpukit/include/rtems/score/stackimpl.h
@@ -22,6 +22,7 @@
#define _RTEMS_SCORE_STACKIMPL_H
#include <rtems/score/stack.h>
+#include <rtems/score/context.h>
#ifdef __cplusplus
extern "C" {
@@ -74,15 +75,27 @@ RTEMS_INLINE_ROUTINE uint32_t _Stack_Minimum (void)
* a valid stack area on this processor, and false otherwise.
*
* @param size The stack size to check.
+ * @param is_fp Indicates if the stack is for a floating-point thread.
*
* @retval true @a size is large enough.
* @retval false @a size is not large enough.
*/
-RTEMS_INLINE_ROUTINE bool _Stack_Is_enough (
- size_t size
+RTEMS_INLINE_ROUTINE bool _Stack_Is_enough(
+ size_t size,
+ bool is_fp
)
{
- return ( size >= _Stack_Minimum() );
+ size_t minimum;
+
+ minimum = _Stack_Minimum();
+
+#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
+ if ( is_fp ) {
+ minimum += CONTEXT_FP_SIZE;
+ }
+#endif
+
+ return ( size >= minimum );
}
/**