summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadcreate.c
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/posix/src/pthreadcreate.c
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/posix/src/pthreadcreate.c')
-rw-r--r--cpukit/posix/src/pthreadcreate.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index 93e6fd89a5..47a408b333 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -97,6 +97,12 @@ int pthread_create(
return EINVAL;
/*
+ * Currently all POSIX threads are floating point if the hardware
+ * supports it.
+ */
+ is_fp = true;
+
+ /*
* Core Thread Initialize ensures we get the minimum amount of
* stack space if it is allowed to allocate it itself.
*
@@ -104,7 +110,7 @@ int pthread_create(
* twice the minimum.
*/
if ( the_attr->stackaddr != NULL ) {
- if ( !_Stack_Is_enough(the_attr->stacksize) ) {
+ if ( !_Stack_Is_enough( the_attr->stacksize, is_fp ) ) {
return EINVAL;
}
@@ -192,12 +198,6 @@ int pthread_create(
}
/*
- * Currently all POSIX threads are floating point if the hardware
- * supports it.
- */
- is_fp = true;
-
- /*
* Allocate the thread control block.
*
* NOTE: Global threads are not currently supported.