diff options
author | Tomasz Kozlowski <tomasz.kozlowski@qt.io> | 2023-08-29 08:49:52 +0200 |
---|---|---|
committer | Tomasz Kozlowski <tomasz.kozlowski@qt.io> | 2023-09-22 00:50:05 +0200 |
commit | 9ccf12a16b52e526588e0983c6fac80c98451619 (patch) | |
tree | c8b1cca07a9462b485251efd8540919586aee809 /src/qml/memory | |
parent | 38b9d70cb9aa328a1c482334291d496dcb4441a6 (diff) |
Add implementation for stack properties on VxWorks
VxWorks does not have full support for POSIX threads and lacks
pthread_attr_get_np function. Fix this by using taskInfoGet function,
because tasks and threads are interchangeable on VxWorks.
Task-number: QTBUG-115777
Change-Id: Ic284b1985b79e134860fb4dcdff861754bcc2ae4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/memory')
-rw-r--r-- | src/qml/memory/qv4stacklimits.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/qml/memory/qv4stacklimits.cpp b/src/qml/memory/qv4stacklimits.cpp index d610780e39..01c854899a 100644 --- a/src/qml/memory/qv4stacklimits.cpp +++ b/src/qml/memory/qv4stacklimits.cpp @@ -31,6 +31,8 @@ # include <unistd.h> #elif defined(Q_OS_INTEGRITY) # include <INTEGRITY.h> +#elif defined(Q_OS_VXWORKS) +# include <taskLib.h> #elif defined(Q_OS_WASM) # include <emscripten/stack.h> #endif @@ -233,6 +235,22 @@ StackProperties stackProperties() return createStackProperties(reinterpret_cast<void *>(base), size); } +#elif defined(Q_OS_VXWORKS) + +StackProperties stackProperties() +{ + TASK_DESC taskDescription; + taskInfoGet(taskIdSelf(), &taskDescription); + +#if Q_STACK_GROWTH_DIRECTION < 0 + return createStackProperties( + decrementStackPointer(taskDescription.td_pStackBase, taskDescription.td_stackSize), + taskDescription.td_stackSize); +#else + return createStackProperties(taskDescription.td_pStackBase, taskDescription.td_stackSize); +#endif +} + #else StackProperties stackPropertiesGeneric(qsizetype stackSize = 0) |