Lines Matching defs:gki_cb
57 tGKI_CB gki_cb;
267 gki_cb.os.thread_id[p_pthread_info->task_id] = pthread_self();
269 prctl(PR_SET_NAME, (unsigned long)gki_cb.com.OSTName[p_pthread_info->task_id], 0, 0, 0);
272 gki_cb.com.OSTName[p_pthread_info->task_id]);
278 gki_cb.com.OSTName[p_pthread_info->task_id]);
299 memset (&gki_cb, 0, sizeof (gki_cb));
305 gki_cb.com.OSTicks = (UINT32) times(0);
312 p_os = &gki_cb.os;
346 return gki_cb.com.OSTicks;
388 gki_cb.com.OSRdyTbl[task_id] = TASK_READY;
389 gki_cb.com.OSTName[task_id] = taskname;
390 gki_cb.com.OSWaitTmr[task_id] = 0;
391 gki_cb.com.OSWaitEvt[task_id] = 0;
398 pthread_mutex_init(&gki_cb.os.thread_evt_mutex[task_id], NULL);
399 pthread_cond_init (&gki_cb.os.thread_evt_cond[task_id], &cond_attr);
400 pthread_mutex_init(&gki_cb.os.thread_timeout_mutex[task_id], NULL);
401 pthread_cond_init (&gki_cb.os.thread_timeout_cond[task_id], NULL);
413 /* On Android, the new tasks starts running before 'gki_cb.os.thread_id[task_id]' is initialized */
414 /* Pass task_id to new task so it can initialize gki_cb.os.thread_id[task_id] for it calls GKI_wait */
419 ret = pthread_create( &gki_cb.os.thread_id[task_id],
430 if(pthread_getschedparam(gki_cb.os.thread_id[task_id], &policy, ¶m)==0)
451 pthread_setschedparam(gki_cb.os.thread_id[task_id], policy, ¶m);
457 (int)gki_cb.os.thread_id[task_id],
472 if (gki_cb.com.OSRdyTbl[task_id] != TASK_DEAD)
474 gki_cb.com.OSRdyTbl[task_id] = TASK_DEAD;
477 gki_cb.com.OSWaitEvt[task_id] &= ~(TASK_MBOX_0_EVT_MASK|TASK_MBOX_1_EVT_MASK|
481 gki_cb.com.OSTaskTmr0R[task_id] = 0;
482 gki_cb.com.OSTaskTmr0 [task_id] = 0;
486 gki_cb.com.OSTaskTmr1R[task_id] = 0;
487 gki_cb.com.OSTaskTmr1 [task_id] = 0;
491 gki_cb.com.OSTaskTmr2R[task_id] = 0;
492 gki_cb.com.OSTaskTmr2 [task_id] = 0;
496 gki_cb.com.OSTaskTmr3R[task_id] = 0;
497 gki_cb.com.OSTaskTmr3 [task_id] = 0;
505 while ((gki_cb.com.OSWaitEvt[task_id] != 0) && (++i < 10))
508 result = pthread_join( gki_cb.os.thread_id[task_id], NULL );
515 ALOGI( "GKI_shutdown(): task [%s] terminated\n", gki_cb.com.OSTName[task_id]);
548 if (gki_cb.com.OSRdyTbl[task_id] != TASK_DEAD)
551 gki_cb.com.OSWaitEvt[task_id] &= ~(TASK_MBOX_0_EVT_MASK|TASK_MBOX_1_EVT_MASK|
555 gki_cb.com.OSTaskTmr0R[task_id] = 0;
556 gki_cb.com.OSTaskTmr0 [task_id] = 0;
560 gki_cb.com.OSTaskTmr1R[task_id] = 0;
561 gki_cb.com.OSTaskTmr1 [task_id] = 0;
565 gki_cb.com.OSTaskTmr2R[task_id] = 0;
566 gki_cb.com.OSTaskTmr2 [task_id] = 0;
570 gki_cb.com.OSTaskTmr3R[task_id] = 0;
571 gki_cb.com.OSTaskTmr3 [task_id] = 0;
580 pthread_detach(gki_cb.os.thread_id[task_id]);
614 if (gki_cb.com.OSRdyTbl[task_id - 1] != TASK_DEAD)
616 gki_cb.com.OSRdyTbl[task_id - 1] = TASK_DEAD;
619 gki_cb.com.OSWaitEvt[task_id-1] &= ~(TASK_MBOX_0_EVT_MASK|TASK_MBOX_1_EVT_MASK|
626 while ((gki_cb.com.OSWaitEvt[task_id - 1] != 0) && (++i < 10))
629 result = pthread_join( gki_cb.os.thread_id[task_id-1], NULL );
641 pthread_mutex_destroy(&gki_cb.os.GKI_mutex);
645 pthread_mutex_destroy(&gki_cb.os.GKI_trace_mutex);
738 if(gki_cb.com.OSRdyTbl[task_id] != TASK_DEAD)
775 gki_cb.com.OSWaitForEvt[rtask] = flag;
778 pthread_mutex_lock(&gki_cb.os.thread_evt_mutex[rtask]);
780 if (!(gki_cb.com.OSWaitEvt[rtask] & flag))
797 pthread_cond_timedwait(&gki_cb.os.thread_evt_cond[rtask],
798 &gki_cb.os.thread_evt_mutex[rtask], &abstime);
802 pthread_cond_wait(&gki_cb.os.thread_evt_cond[rtask], &gki_cb.os.thread_evt_mutex[rtask]);
813 if (gki_cb.com.OSTaskQFirst[rtask][0])
814 gki_cb.com.OSWaitEvt[rtask] |= TASK_MBOX_0_EVT_MASK;
815 if (gki_cb.com.OSTaskQFirst[rtask][1])
816 gki_cb.com.OSWaitEvt[rtask] |= TASK_MBOX_1_EVT_MASK;
817 if (gki_cb.com.OSTaskQFirst[rtask][2])
818 gki_cb.com.OSWaitEvt[rtask] |= TASK_MBOX_2_EVT_MASK;
819 if (gki_cb.com.OSTaskQFirst[rtask][3])
820 gki_cb.com.OSWaitEvt[rtask] |= TASK_MBOX_3_EVT_MASK;
822 if (gki_cb.com.OSRdyTbl[rtask] == TASK_DEAD)
824 gki_cb.com.OSWaitEvt[rtask] = 0;
826 pthread_mutex_unlock(&gki_cb.os.thread_evt_mutex[rtask]);
832 gki_cb.com.OSWaitForEvt[rtask] = 0;
835 evt = gki_cb.com.OSWaitEvt[rtask] & flag;
838 gki_cb.com.OSWaitEvt[rtask] &= ~flag;
841 pthread_mutex_unlock(&gki_cb.os.thread_evt_mutex[rtask]);
882 if (rtask && gki_cb.com.OSRdyTbl[rtask] == TASK_DEAD)
915 pthread_mutex_lock(&gki_cb.os.thread_evt_mutex[task_id]);
918 gki_cb.com.OSWaitEvt[task_id] |= event;
920 pthread_cond_signal(&gki_cb.os.thread_evt_cond[task_id]);
922 pthread_mutex_unlock(&gki_cb.os.thread_evt_mutex[task_id]);
955 if (gki_cb.os.thread_id[i] == thread_id) {
991 GKI_TRACE("GKI_map_taskname %d %s done", task_id, gki_cb.com.OSTName[task_id]);
992 return (gki_cb.com.OSTName[task_id]);
996 return (gki_cb.com.OSTName[GKI_get_taskid()]);
1016 pthread_mutex_unlock(&gki_cb.os.GKI_mutex);
1032 pthread_mutex_lock(&gki_cb.os.GKI_mutex);
1061 gki_cb.com.OSTName[task_id],
1062 gki_cb.com.OSRdyTbl[task_id]);
1073 if (gki_cb.com.ExceptionCnt < GKI_MAX_EXCEPTION)
1077 pExp = &gki_cb.com.Exception[gki_cb.com.ExceptionCnt++];
1149 gki_cb.com.OSRdyTbl[task_id] = TASK_DEAD;
1152 pthread_mutex_destroy(&gki_cb.os.thread_evt_mutex[task_id]);
1153 pthread_cond_destroy (&gki_cb.os.thread_evt_cond[task_id]);
1154 pthread_mutex_destroy(&gki_cb.os.thread_timeout_mutex[task_id]);
1155 pthread_cond_destroy (&gki_cb.os.thread_timeout_cond[task_id]);