Fix Add RTEMS timebase callback wrapper
@@ -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
@@ -391,7 +409,7 @@ int32 OS_TimeBaseCreate_Impl(const OS_object_token_t *token)
{
/* 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_entry)OS_TimeBase_CallbackThreadEntry, /* task entry point */
(rtems_task_argument)r_name); /* passed argument */
if (rtems_sc != RTEMS_SUCCESSFUL)
