|
|
| version 1.17.2.1, 2013/05/26 20:14:02 | version 1.21.6.1, 2013/08/26 18:42:32 |
|---|---|
| Line 91 typedef enum { | Line 91 typedef enum { |
| taskREADY, | taskREADY, |
| taskUNUSE, | taskUNUSE, |
| taskTHREAD, | taskTHREAD, |
| taskRTC, | |
| taskMAX | taskMAX |
| } sched_task_type_t; | } sched_task_type_t; |
| Line 126 struct sched_HooksTask { | Line 127 struct sched_HooksTask { |
| sched_hook_func_t suspend; | sched_hook_func_t suspend; |
| /* thread(sched_task_t *task, NULL) -> int */ | /* thread(sched_task_t *task, NULL) -> int */ |
| sched_hook_func_t thread; | sched_hook_func_t thread; |
| /* rtc(sched_task_t *task, NULL) -> int */ | |
| sched_hook_func_t rtc; | |
| } hook_add; | } hook_add; |
| struct { | struct { |
| /* exit(sched_task_t *task, void *exitValue) -> int */ | /* exit(sched_task_t *task, void *exitValue) -> int */ |
| Line 176 struct sched_Task { | Line 179 struct sched_Task { |
| #define TASK_FUNC(x) (x)->task_func | #define TASK_FUNC(x) (x)->task_func |
| intptr_t task_ret; | intptr_t task_ret; |
| #define TASK_RET(x) (x)->task_ret | #define TASK_RET(x) (x)->task_ret |
| unsigned int task_flag; | unsigned long task_flag; |
| #define TASK_FLAG(x) (x)->task_flag | #define TASK_FLAG(x) (x)->task_flag |
| void *task_arg; | void *task_arg; |
| Line 231 struct sched_RootTask { | Line 234 struct sched_RootTask { |
| sched_queue_t root_ready; | sched_queue_t root_ready; |
| sched_queue_t root_unuse; | sched_queue_t root_unuse; |
| sched_queue_t root_thread; | sched_queue_t root_thread; |
| sched_queue_t root_rtc; | |
| hooks_task_t root_hooks; | hooks_task_t root_hooks; |
| struct iovec root_data; | struct iovec root_data; |
| Line 381 sched_task_t *schedWrite(sched_root_task_t * __restric | Line 385 sched_task_t *schedWrite(sched_root_task_t * __restric |
| * @func = task execution function | * @func = task execution function |
| * @arg = 1st func argument | * @arg = 1st func argument |
| * @ts = timeout argument structure, minimum alarm timer resolution is 1msec! | * @ts = timeout argument structure, minimum alarm timer resolution is 1msec! |
| * @opt_data = Optional data | * @opt_data = Alarm timer ID |
| * @opt_dlen = Optional data length | * @opt_dlen = Optional data length |
| * return: NULL error or !=NULL new queued task | * return: NULL error or !=NULL new queued task |
| */ | */ |
| Line 390 sched_task_t *schedAlarm(sched_root_task_t * __restric | Line 394 sched_task_t *schedAlarm(sched_root_task_t * __restric |
| #define schedAlarmSelf(x) schedAlarm(TASK_ROOT((x)), TASK_FUNC((x)), TASK_ARG((x)), \ | #define schedAlarmSelf(x) schedAlarm(TASK_ROOT((x)), TASK_FUNC((x)), TASK_ARG((x)), \ |
| TASK_TS((x)), TASK_DATA((x)), TASK_DATLEN((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 = Optional 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 | * schedNode() - Add NODE task to scheduler queue |
| * | * |
| * @root = root task | * @root = root task |
| Line 557 int schedTrigger(sched_task_t * __restrict task); | Line 576 int schedTrigger(sched_task_t * __restrict task); |
| */ | */ |
| sched_task_t *schedTimer(sched_root_task_t * __restrict root, sched_task_func_t func, void *arg, | sched_task_t *schedTimer(sched_root_task_t * __restrict root, sched_task_func_t func, void *arg, |
| struct timespec ts, void *opt_data, size_t opt_dlen); | struct timespec ts, void *opt_data, size_t opt_dlen); |
| #define schedTimerSelf(x) schedTimer(TASK_ROOT((x)), TASK_FUNC((x)), TASK_ARG((x)), \ | |
| TASK_TS((x)), TASK_DATA((x)), TASK_DATLEN((x))) | |
| /* | /* |
| * schedEvent() - Add EVENT task to scheduler queue | * schedEvent() - Add EVENT task to scheduler queue |
| * | * |
| Line 637 sched_task_t *schedCallOnce(sched_root_task_t * __rest | Line 654 sched_task_t *schedCallOnce(sched_root_task_t * __rest |
| * @root = root task | * @root = root task |
| * @func = task execution function | * @func = task execution function |
| * @arg = 1st func argument | * @arg = 1st func argument |
| * @detach = Detach thread from scheduler, if !=0 | |
| * @ss = stack size | * @ss = stack size |
| * @opt_data = Optional data | * @opt_data = Optional data |
| * @opt_dlen = Optional data length | * @opt_dlen = Optional data length |
| * return: NULL error or !=NULL new queued task | * return: NULL error or !=NULL new queued task |
| */ | */ |
| sched_task_t *schedThread(sched_root_task_t * __restrict root, sched_task_func_t func, void *arg, | sched_task_t *schedThread(sched_root_task_t * __restrict root, sched_task_func_t func, void *arg, |
| int detach, size_t ss, void *opt_data, size_t opt_dlen); | size_t ss, void *opt_data, size_t opt_dlen); |
| #define schedThreadSelf(x) schedThread(TASK_ROOT((x)), TASK_FUNC((x)), TASK_ARG((x)), \ | #define schedThreadSelf(x) schedThread(TASK_ROOT((x)), TASK_FUNC((x)), TASK_ARG((x)), \ |
| (TASK_FLAG((x)) & 0x1), (size_t) (TASK_FLAG((x)) >> 1), TASK_DATA((x)), TASK_DATLEN((x))) | (size_t) TASK_FLAG((x)), TASK_DATA((x)), TASK_DATLEN((x))) |
| /* | /* |
| * sched_taskExit() - Exit routine for scheduler task, explicit required for thread tasks | * sched_taskExit() - Exit routine for scheduler task, explicit required for thread tasks |
| * | * |