From aadcb727d472fbe682130e66c81a2bc60ae4db3a Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 3 Aug 2023 17:02:32 +0000 Subject: [PATCH 1/3] Fix #1281, Set RTEMS task name for cpuuse --- src/os/rtems/src/os-impl-tasks.c | 5 +++++ 1 file changed, 5 insertions(+) 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 */ From fd199a82b54d0b2a63471db9e7c79fd261bcc306 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Fri, 25 Aug 2023 16:49:34 +0000 Subject: [PATCH 2/3] Fix #1406, Squash RTEMS countsem take timeout bug --- src/os/rtems/src/os-impl-binsem.c | 16 +++++++++++++++- src/os/rtems/src/os-impl-countsem.c | 17 ++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) 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; From 55939fb2aead3c26dbe2a2ab132f67f8d6ec8d10 Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 13 Sep 2023 09:19:34 -0400 Subject: [PATCH 3/3] Updating documentation and version numbers for v6.0.0-rc4+dev235 --- CHANGELOG.md | 7 ++++++- src/os/inc/osapi-version.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) 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" /*