diff --git a/CHANGELOG.md b/CHANGELOG.md index 486dc66c2..4958742c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog -## Development Build: v6.0.0-4c4+dev229 +## Development Build: v6.0.0-rc4+dev235 +- Set RTEMS task name for cpuuse +- Squash RTEMS sem take timeout bug +- See and + +## Development Build: v6.0.0-rc4+dev229 - Fixes errors in IC Bundle workflow file - See diff --git a/src/os/inc/osapi-version.h b/src/os/inc/osapi-version.h index 76314df82..bd6ec3751 100644 --- a/src/os/inc/osapi-version.h +++ b/src/os/inc/osapi-version.h @@ -34,7 +34,7 @@ /* * Development Build Macro Definitions */ -#define OS_BUILD_NUMBER 229 +#define OS_BUILD_NUMBER 235 #define OS_BUILD_BASELINE "v6.0.0-rc4" /* diff --git a/src/os/rtems/src/os-impl-binsem.c b/src/os/rtems/src/os-impl-binsem.c index c530ee618..187d88fa4 100644 --- a/src/os/rtems/src/os-impl-binsem.c +++ b/src/os/rtems/src/os-impl-binsem.c @@ -225,6 +225,7 @@ int32 OS_BinSemTake_Impl(const OS_object_token_t *token) int32 OS_BinSemTimedWait_Impl(const OS_object_token_t *token, uint32 msecs) { rtems_status_code status; + rtems_option option_set; int TimeInTicks; OS_impl_binsem_internal_record_t *impl; @@ -235,7 +236,20 @@ int32 OS_BinSemTimedWait_Impl(const OS_object_token_t *token, uint32 msecs) return OS_ERROR; } - status = rtems_semaphore_obtain(impl->id, RTEMS_WAIT, TimeInTicks); + /* Select appropriate option to wait or not + * - RTEMS_WAIT with 0 timeout causes RTEMS to wait forever + * - RTEMS_NO_WAIT returns immediately (ignores TimeInTicks) + */ + if (TimeInTicks == 0) + { + option_set = RTEMS_NO_WAIT; + } + else + { + option_set = RTEMS_WAIT; + } + + status = rtems_semaphore_obtain(impl->id, option_set, TimeInTicks); if (status == RTEMS_TIMEOUT) { diff --git a/src/os/rtems/src/os-impl-countsem.c b/src/os/rtems/src/os-impl-countsem.c index 2f9533818..979ec365a 100644 --- a/src/os/rtems/src/os-impl-countsem.c +++ b/src/os/rtems/src/os-impl-countsem.c @@ -190,6 +190,7 @@ int32 OS_CountSemTake_Impl(const OS_object_token_t *token) int32 OS_CountSemTimedWait_Impl(const OS_object_token_t *token, uint32 msecs) { rtems_status_code status; + rtems_option option_set; int TimeInTicks; OS_impl_countsem_internal_record_t *impl; @@ -200,7 +201,21 @@ int32 OS_CountSemTimedWait_Impl(const OS_object_token_t *token, uint32 msecs) return OS_ERROR; } - status = rtems_semaphore_obtain(impl->id, RTEMS_WAIT, TimeInTicks); + /* Select appropriate option to wait or not + * - RTEMS_WAIT with 0 timeout causes RTEMS to wait forever + * - RTEMS_NO_WAIT returns immediately (ignores TimeInTicks) + */ + if (TimeInTicks == 0) + { + option_set = RTEMS_NO_WAIT; + } + else + { + option_set = RTEMS_WAIT; + } + + status = rtems_semaphore_obtain(impl->id, option_set, TimeInTicks); + if (status == RTEMS_TIMEOUT) { return OS_SEM_TIMEOUT; diff --git a/src/os/rtems/src/os-impl-tasks.c b/src/os/rtems/src/os-impl-tasks.c index 64c9e8b7a..10e09943b 100644 --- a/src/os/rtems/src/os-impl-tasks.c +++ b/src/os/rtems/src/os-impl-tasks.c @@ -33,6 +33,9 @@ INCLUDE FILES ***************************************************************************************/ +#define _GNU_SOURCE +#include + #include "os-rtems.h" #include "os-impl-tasks.h" @@ -126,6 +129,8 @@ int32 OS_TaskCreate_Impl(const OS_object_token_t *token, uint32 flags) return OS_ERROR; } + pthread_setname_np(impl->id, task->task_name); + /* will place the task in 'ready for scheduling' state */ status = rtems_task_start(impl->id, /*rtems task id*/ (rtems_task_entry)OS_RtemsEntry, /* task entry point */