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

Fix #1432 #1411, RTEMS semaphore return bugs and functional test update #1438

Merged
merged 2 commits into from
Jan 10, 2024
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
1 change: 1 addition & 0 deletions src/os/inc/osapi-binsem.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ int32 OS_BinSemGetIdByName(osal_id_t *sem_id, const char *sem_name);
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_ERR_INVALID_ID if the id passed in is not a valid semaphore
* @retval #OS_INVALID_POINTER if the bin_prop pointer is null
* @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED
*/
int32 OS_BinSemGetInfo(osal_id_t sem_id, OS_bin_sem_prop_t *bin_prop);

Expand Down
1 change: 1 addition & 0 deletions src/os/inc/osapi-countsem.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ int32 OS_CountSemGetIdByName(osal_id_t *sem_id, const char *sem_name);
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_ERR_INVALID_ID if the id passed in is not a valid semaphore
* @retval #OS_INVALID_POINTER if the count_prop pointer is null
* @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED
*/
int32 OS_CountSemGetInfo(osal_id_t sem_id, OS_count_sem_prop_t *count_prop);

Expand Down
4 changes: 2 additions & 2 deletions src/os/rtems/src/os-impl-binsem.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ int32 OS_BinSemTimedWait_Impl(const OS_object_token_t *token, uint32 msecs)

status = rtems_semaphore_obtain(impl->id, option_set, TimeInTicks);

if (status == RTEMS_TIMEOUT)
if (status == RTEMS_TIMEOUT || (option_set == RTEMS_NO_WAIT && status == RTEMS_UNSATISFIED))
{
return OS_SEM_TIMEOUT;
}
Expand All @@ -275,5 +275,5 @@ int32 OS_BinSemTimedWait_Impl(const OS_object_token_t *token, uint32 msecs)
int32 OS_BinSemGetInfo_Impl(const OS_object_token_t *token, OS_bin_sem_prop_t *bin_prop)
{
/* RTEMS has no API for obtaining the current value of a semaphore */
return OS_SUCCESS;
return OS_ERR_NOT_IMPLEMENTED;
}
4 changes: 2 additions & 2 deletions src/os/rtems/src/os-impl-countsem.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ int32 OS_CountSemTimedWait_Impl(const OS_object_token_t *token, uint32 msecs)

status = rtems_semaphore_obtain(impl->id, option_set, TimeInTicks);

if (status == RTEMS_TIMEOUT)
if (status == RTEMS_TIMEOUT || (option_set == RTEMS_NO_WAIT && status == RTEMS_UNSATISFIED))
{
return OS_SEM_TIMEOUT;
}
Expand All @@ -239,5 +239,5 @@ int32 OS_CountSemTimedWait_Impl(const OS_object_token_t *token, uint32 msecs)
int32 OS_CountSemGetInfo_Impl(const OS_object_token_t *token, OS_count_sem_prop_t *count_prop)
{
/* RTEMS does not provide an API to get the value */
return OS_SUCCESS;
return OS_ERR_NOT_IMPLEMENTED;
}
291 changes: 0 additions & 291 deletions src/tests/bin-sem-flush-test/bin-sem-flush-test.c

This file was deleted.

Loading
Loading