Home | History | Annotate | Download | only in ulinux

Lines Matching defs:task_id

69   uint8_t task_id;         /* GKI task id */
90 "gki_task_entry task_id=%i, thread_id=%lx/%lx, pCond/pMutex=%p/%p",
91 p_pthread_info->task_id, gki_cb.os.thread_id[p_pthread_info->task_id],
94 gki_cb.os.thread_id[p_pthread_info->task_id] = thread_id;
98 LOG(ERROR) << StringPrintf("gki_task task_id=%i terminating",
99 p_pthread_info->task_id);
100 gki_cb.os.thread_id[p_pthread_info->task_id] = 0;
170 ** task_id - (input) Task id is mapped to priority
184 uint8_t GKI_create_task(TASKPTR task_entry, uint8_t task_id, int8_t* taskname,
196 task_entry, task_id, taskname, stack, stacksize);
198 if (task_id >= GKI_MAX_TASKS) {
204 gki_cb.com.OSRdyTbl[task_id] = TASK_READY;
205 gki_cb.com.OSTName[task_id] = taskname;
206 gki_cb.com.OSWaitTmr[task_id] = 0;
207 gki_cb.com.OSWaitEvt[task_id] = 0;
210 pthread_mutex_init(&gki_cb.os.thread_evt_mutex[task_id], NULL);
211 pthread_cond_init(&gki_cb.os.thread_evt_cond[task_id], &attr);
212 pthread_mutex_init(&gki_cb.os.thread_timeout_mutex[task_id], NULL);
213 pthread_cond_init(&gki_cb.os.thread_timeout_cond[task_id], &attr);
221 "GKI creating task %i, pCond/pMutex=%p/%p", task_id, pCondVar, pMutex);
224 << StringPrintf("GKI creating JOINABLE task %i", task_id);
228 * 'gki_cb.os.thread_id[task_id]' is initialized */
229 /* Pass task_id to new task so it can initialize gki_cb.os.thread_id[task_id]
231 gki_pthread_info[task_id].task_id = task_id;
232 gki_pthread_info[task_id].task_entry = task_entry;
233 gki_pthread_info[task_id].params = 0;
234 gki_pthread_info[task_id].pCond = (pthread_cond_t*)pCondVar;
235 gki_pthread_info[task_id].pMutex = (pthread_mutex_t*)pMutex;
237 ret = pthread_create(&gki_cb.os.thread_id[task_id], &attr1, gki_task_entry,
238 &gki_pthread_info[task_id]);
246 if (pthread_getschedparam(gki_cb.os.thread_id[task_id], &policy, &param) ==
249 if (task_id == PBS_SQL_TASK) {
257 param.sched_priority = 30 - task_id - 2;
259 pthread_setschedparam(gki_cb.os.thread_id[task_id], policy, &param);
263 "Leaving GKI_create_task %p %d %lx %s %p %d", task_entry, task_id,
264 gki_cb.os.thread_id[task_id], taskname, stack, stacksize);
287 uint8_t task_id;
298 for (task_id = GKI_MAX_TASKS; task_id > 0; task_id--) {
299 if (gki_cb.com.OSRdyTbl[task_id - 1] != TASK_DEAD) {
300 gki_cb.com.OSRdyTbl[task_id - 1] = TASK_DEAD;
304 gki_cb.com.OSWaitEvt[task_id - 1] &=
307 GKI_send_event(task_id - 1, EVENT_MASK(GKI_SHUTDOWN_EVT));
312 while ((gki_cb.com.OSWaitEvt[task_id - 1] != 0) && (++i < 10))
316 result = pthread_join(gki_cb.os.thread_id[task_id - 1], NULL);
323 << StringPrintf("task %s dead", gki_cb.com.OSTName[task_id]);
324 GKI_exit_task(task_id - 1);
540 uint8_t task_id;
545 for (task_id = 0; task_id < GKI_MAX_TASKS; task_id++) {
546 if (gki_cb.com.OSRdyTbl[task_id] != TASK_DEAD) {
547 GKI_exit_task(task_id);
740 ** Parameters: task_id - (input) The id of the task to which the event has
748 uint8_t GKI_send_event(uint8_t task_id, uint16_t event) {
750 if (task_id < GKI_MAX_TASKS) {
751 /* protect OSWaitEvt[task_id] from manipulation in GKI_wait() */
752 pthread_mutex_lock(&gki_cb.os.thread_evt_mutex[task_id]);
755 gki_cb.com.OSWaitEvt[task_id] |= event;
757 pthread_cond_signal(&gki_cb.os.thread_evt_cond[task_id]);
759 pthread_mutex_unlock(&gki_cb.os.thread_evt_mutex[task_id]);
775 ** Parameters: task_id - (input) The destination task Id for the event.
786 uint8_t GKI_isend_event(uint8_t task_id, uint16_t event) {
788 << StringPrintf("GKI_isend_event %d %x", task_id, event);
790 << StringPrintf("GKI_isend_event %d %x done", task_id, event);
791 return GKI_send_event(task_id, event);
827 ** Parameters: task_id - (input) The id of the task whose name is being
836 int8_t* GKI_map_taskname(uint8_t task_id) {
838 << StringPrintf("GKI_map_taskname %d", task_id);
840 if (task_id < GKI_MAX_TASKS) {
842 "GKI_map_taskname %d %s done", task_id, gki_cb.com.OSTName[task_id]);
843 return (gki_cb.com.OSTName[task_id]);
844 } else if (task_id == GKI_MAX_TASKS) {
906 uint8_t task_id;
910 for (task_id = 0; task_id < GKI_MAX_TASKS; task_id++) {
912 task_id, gki_cb.com.OSTName[task_id],
913 gki_cb.com.OSRdyTbl[task_id]);
1041 ** Parameters: task_id - (input) the id of the task that has to suspended
1050 uint8_t GKI_suspend_task(uint8_t task_id) {
1052 << StringPrintf("GKI_suspend_task %d - NOT implemented", task_id);
1055 << StringPrintf("GKI_suspend_task %d done", task_id);
1066 ** Parameters: task_id - (input) the id of the task that has to resumed
1075 uint8_t GKI_resume_task(uint8_t task_id) {
1077 << StringPrintf("GKI_resume_task %d - NOT implemented", task_id);
1080 << StringPrintf("GKI_resume_task %d done", task_id);
1091 ** Parameters: task_id - (input) the id of the task that has to be stopped
1100 void GKI_exit_task(uint8_t task_id) {
1101 if (task_id >= GKI_MAX_TASKS) {
1105 gki_cb.com.OSRdyTbl[task_id] = TASK_DEAD;
1108 pthread_mutex_destroy(&gki_cb.os.thread_evt_mutex[task_id]);
1109 pthread_cond_destroy(&gki_cb.os.thread_evt_cond[task_id]);
1110 pthread_mutex_destroy(&gki_cb.os.thread_timeout_mutex[task_id]);
1111 pthread_cond_destroy(&gki_cb.os.thread_timeout_cond[task_id]);
1115 // GKI_send_event(task_id, EVENT_MASK(GKI_SHUTDOWN_EVT));
1118 << StringPrintf("GKI_exit_task %d done", task_id);