Skip to content

Commit

Permalink
Merge pull request #1414 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
osal Integration candidate: Caelum-rc4+dev58
  • Loading branch information
dzbaker authored Sep 13, 2023
2 parents dc548b7 + 55939fb commit b5dd01c
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
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

0 comments on commit b5dd01c

Please sign in to comment.