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 #1244, Add RTEMS timebase callback wrapper #1276

Closed
wants to merge 2 commits into from
Closed
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
24 changes: 21 additions & 3 deletions src/os/rtems/src/os-impl-timebase.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,24 @@ void OS_UsecsToTicks(uint32 usecs, rtems_interval *ticks)
/* The user may specify whether to use priority inheritance on mutexes via osconfig.h */
#define OSAL_TIMEBASE_MUTEX_ATTRIBS RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY

/*----------------------------------------------------------------
*
* Function: OS_TimeBase_CallbackThreadEntry
*
* Purpose: Local helper routine, not part of OSAL API.
* Wrapper function used by OS_TimeBaseCreate_Impl to
* convert the rtems_task_argument on newly created
* timebase task into an osal_id_t used by the
* OS_TimeBase_CallbackThread.
*
*-----------------------------------------------------------------*/
static void OS_TimeBase_CallbackThreadEntry(rtems_task_argument arg)
{
osal_id_t id;
id = OS_ObjectIdFromInteger(arg);
OS_TimeBase_CallbackThread(id);
}

/*----------------------------------------------------------------
*
* Function: OS_TimeBaseCreate_Impl
Expand Down Expand Up @@ -390,9 +408,9 @@ int32 OS_TimeBaseCreate_Impl(const OS_object_token_t *token)
else
{
/* will place the task in 'ready for scheduling' state */
rtems_sc = rtems_task_start(local->handler_task, /*rtems task id*/
(rtems_task_entry)OS_TimeBase_CallbackThread, /* task entry point */
(rtems_task_argument)r_name); /* passed argument */
rtems_sc = rtems_task_start(local->handler_task, /* rtems task id */
OS_TimeBase_CallbackThreadEntry, /* task entry point */
(rtems_task_argument)r_name); /* passed argument */

if (rtems_sc != RTEMS_SUCCESSFUL)
{
Expand Down