Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osal Integration candidate: Caelum-rc4+dev58 #1414

Merged
merged 5 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/nasa/osal/pull/1407> and <https://github.com/nasa/osal/pull/1408>

## Development Build: v6.0.0-rc4+dev229
- Fixes errors in IC Bundle workflow file
- See <https://github.com/nasa/osal/pull/1403>

Expand Down
2 changes: 1 addition & 1 deletion src/os/inc/osapi-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

/*
Expand Down
16 changes: 15 additions & 1 deletion src/os/rtems/src/os-impl-binsem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
{
Expand Down
17 changes: 16 additions & 1 deletion src/os/rtems/src/os-impl-countsem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/os/rtems/src/os-impl-tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
INCLUDE FILES
***************************************************************************************/

#define _GNU_SOURCE
#include <pthread.h>

#include "os-rtems.h"
#include "os-impl-tasks.h"

Expand Down Expand Up @@ -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 */
Expand Down
Loading