--- libaitsched/inc/aitsched.h 2013/06/19 00:16:35 1.19 +++ libaitsched/inc/aitsched.h 2013/08/15 17:58:30 1.19.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitsched.h,v 1.19 2013/06/19 00:16:35 misho Exp $ +* $Id: aitsched.h,v 1.19.2.2 2013/08/15 17:58:30 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -91,6 +91,7 @@ typedef enum { taskREADY, taskUNUSE, taskTHREAD, + taskRTC, taskMAX } sched_task_type_t; @@ -126,6 +127,8 @@ struct sched_HooksTask { sched_hook_func_t suspend; /* thread(sched_task_t *task, NULL) -> int */ sched_hook_func_t thread; + /* rtc(sched_task_t *task, NULL) -> int */ + sched_hook_func_t rtc; } hook_add; struct { /* exit(sched_task_t *task, void *exitValue) -> int */ @@ -231,6 +234,7 @@ struct sched_RootTask { sched_queue_t root_ready; sched_queue_t root_unuse; sched_queue_t root_thread; + sched_queue_t root_rtc; hooks_task_t root_hooks; struct iovec root_data; @@ -381,13 +385,28 @@ sched_task_t *schedWrite(sched_root_task_t * __restric * @func = task execution function * @arg = 1st func argument * @ts = timeout argument structure, minimum alarm timer resolution is 1msec! - * @opt_data = Optional data + * @opt_data = Alarm timer ID * @opt_dlen = Optional data length * return: NULL error or !=NULL new queued task */ sched_task_t *schedAlarm(sched_root_task_t * __restrict root, sched_task_func_t func, void *arg, struct timespec ts, void *opt_data, size_t opt_dlen); #define schedAlarmSelf(x) schedAlarm(TASK_ROOT((x)), TASK_FUNC((x)), TASK_ARG((x)), \ + TASK_TS((x)), TASK_DATA((x)), TASK_DATLEN((x))) +/* + * schedRTC() - Add RTC task to scheduler queue + * + * @root = root task + * @func = task execution function + * @arg = 1st func argument + * @ts = timeout argument structure, minimum alarm timer resolution is 1msec! + * @opt_data = RTC ID + * @opt_dlen = Optional data length + * return: NULL error or !=NULL new queued task + */ +sched_task_t *schedRTC(sched_root_task_t * __restrict root, sched_task_func_t func, void *arg, + struct timespec ts, void *opt_data, size_t opt_dlen); +#define schedRTCSelf(x) schedRTC(TASK_ROOT((x)), TASK_FUNC((x)), TASK_ARG((x)), \ TASK_TS((x)), TASK_DATA((x)), TASK_DATLEN((x))) /* * schedNode() - Add NODE task to scheduler queue