ubinos
task.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 Sung Ho Park
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef UBIK_TASK_H_
8 #define UBIK_TASK_H_
9 
10 #ifdef __cplusplus
11 extern "C"
12 {
13 #endif
14 
324 #include <ubinos_config.h>
325 #include <ubinos/type.h>
326 
329 #define TASK_WAITOPT__IGNOREINVALID 0x80
330 
332 #define TASK_WAITOPT__ALL 0x40
333 
335 #define TASK_OPT__NOAUTODEL 0x40
336 
338 typedef void (*taskfunc_ft)(void *);
339 
341 typedef struct __task_tip_t
342 {
343  unsigned int type :8;
344  unsigned int valid :1;
345  unsigned int reserved :7;
346  unsigned int reserved2 :16;
348 
351 
387 int task_create(task_pt * task_p, taskfunc_ft func, void * arg, int priority,
388  unsigned int stackdepth, const char * name);
389 
427 int task_create_noautodel(task_pt * task_p, taskfunc_ft func, void * arg, int priority,
428  unsigned int stackdepth, const char * name);
429 
476 int task_create_ext(task_pt * task_p, taskfunc_ft func, void * arg,
477  int priority, unsigned int stackdepth, const char * name,
478  unsigned int tag, unsigned int option);
479 
494 int task_delete(task_pt * task_p);
495 
509 
522 
533 int task_sleep(unsigned int tick);
534 
545 int task_sleepms(unsigned int timems);
546 
567 int task_setpriority(task_pt task, int priority);
568 
585 
592 
599 
606 
610 void task_lock(void);
611 
615 void task_unlock(void);
616 
620 void task_yield(void);
621 
637 int task_setmaxwaitsigobj(task_pt task, int max);
638 
652 
689 int task_waitforsigobjs(void ** sigobj_p, int * sigtype_p, void ** param_p,
690  int count, unsigned int waitopt);
691 
732 int task_waitforsigobjs_timed(void ** sigobj_p, int * sigtype_p,
733  void ** param_p, int count, unsigned int waitopt, unsigned int tick);
734 
775 int task_waitforsigobjs_timedms(void ** sigobj_p, int * sigtype_p,
776  void ** param_p, int count, unsigned int waitopt, unsigned int timems);
777 
802 int task_join(task_pt * task_p, int * result_p, int count);
803 
833 int task_join_timed(task_pt * task_p, int * result_p, int count,
834  unsigned int tick);
835 
865 int task_join_timedms(task_pt * task_p, int * result_p, int count,
866  unsigned int timems);
867 
892 int task_join_and_delete(task_pt * task_p, int * result_p, int count);
893 
921 int task_join_and_delete_timed(task_pt * task_p, int * result_p, int count, unsigned int tick);
922 
950 int task_join_and_delete_timedms(task_pt * task_p, int * result_p, int count, unsigned int timems);
951 
960 
969 unsigned int task_getremainingtimeout(void);
970 
979 unsigned int task_getremainingtimeoutms(void);
980 
986 unsigned int task_getminstackdepth(void);
987 
993 unsigned int task_getdefaultstackdepth(void);
994 
1010 int task_getstacksize(task_pt task, unsigned int * stacksize_p);
1011 
1027 int task_getmaxstackusage(task_pt task, unsigned int * maxstackusage_p);
1028 
1040 
1041 #ifdef __cplusplus
1042 }
1043 #endif
1044 
1045 #endif /* UBIK_TASK_H_ */
Definition: task.h:342
unsigned int reserved2
Definition: task.h:346
unsigned int valid
Definition: task.h:344
unsigned int type
Definition: task.h:343
unsigned int reserved
Definition: task.h:345
int task_getmaxstackusage(task_pt task, unsigned int *maxstackusage_p)
int task_getlowestpriority(void)
int task_join_timed(task_pt *task_p, int *result_p, int count, unsigned int tick)
task_pt task_getcur(void)
int task_setmaxwaitsigobj(task_pt task, int max)
int task_sleepms(unsigned int timems)
int task_join_timedms(task_pt *task_p, int *result_p, int count, unsigned int timems)
_task_tip_t * task_pt
Definition: task.h:350
int task_getstacksize(task_pt task, unsigned int *stacksize_p)
int task_create_noautodel(task_pt *task_p, taskfunc_ft func, void *arg, int priority, unsigned int stackdepth, const char *name)
unsigned int task_getdefaultstackdepth(void)
struct __task_tip_t _task_tip_t
int task_getmaxwaitsigobj(task_pt task)
int task_waitforsigobjs_timedms(void **sigobj_p, int *sigtype_p, void **param_p, int count, unsigned int waitopt, unsigned int timems)
void task_unlock(void)
int task_is_idle(task_pt task)
unsigned int task_getremainingtimeout(void)
int task_join_and_delete(task_pt *task_p, int *result_p, int count)
void task_lock(void)
int task_getmiddlepriority(void)
int task_waitforsigobjs_timed(void **sigobj_p, int *sigtype_p, void **param_p, int count, unsigned int waitopt, unsigned int tick)
int task_waitforsigobjs(void **sigobj_p, int *sigtype_p, void **param_p, int count, unsigned int waitopt)
int task_join(task_pt *task_p, int *result_p, int count)
int task_sleep(unsigned int tick)
void(* taskfunc_ft)(void *)
Definition: task.h:338
int task_setpriority(task_pt task, int priority)
unsigned int task_getremainingtimeoutms(void)
int task_join_and_delete_timedms(task_pt *task_p, int *result_p, int count, unsigned int timems)
int task_resume(task_pt task)
int task_create_ext(task_pt *task_p, taskfunc_ft func, void *arg, int priority, unsigned int stackdepth, const char *name, unsigned int tag, unsigned int option)
int task_delete(task_pt *task_p)
int task_suspend(task_pt task)
int task_getpriority(task_pt task)
void task_yield(void)
int task_gethighestpriority(void)
int task_join_and_delete_timed(task_pt *task_p, int *result_p, int count, unsigned int tick)
int task_create(task_pt *task_p, taskfunc_ft func, void *arg, int priority, unsigned int stackdepth, const char *name)
unsigned int task_getminstackdepth(void)
ubinos basic data type