Lines Matching refs:osi_info
28 tOSI_INFO osi_info; variable
33 memset(&osi_info, 0, sizeof(osi_info)); in OSI_init()
36 pthread_mutex_init(&osi_info.mutex, NULL); in OSI_init()
40 osi_info.task[index].state = OSI_FREE; in OSI_init()
44 osi_info.mem_max_cnt = OSI_MAX_MEM_POOL; in OSI_init()
47 osi_info.mem[index] = (tOSI_MEM_HANDLER)malloc(OSI_MEM_POOL_SIZE); in OSI_init()
48 if (osi_info.mem[index] == NULL) { in OSI_init()
51 osi_info.mem_max_cnt = index; in OSI_init()
54 osi_info.mem[index]->state = OSI_FREE; in OSI_init()
56 osi_info.mem[index].state = OSI_FREE; in OSI_init()
61 osi_info.queue_max_cnt = OSI_MAX_QUEUE; in OSI_init()
63 osi_info.queue[index].state = OSI_FREE; in OSI_init()
64 osi_info.queue[index].tail = OSI_QUEUE_SIZE; in OSI_init()
69 osi_info.timer[index].state = OSI_FREE; in OSI_init()
70 osi_info.timer[index].name = NULL; in OSI_init()
71 osi_info.timer[index].callback = NULL; in OSI_init()
72 osi_info.timer[index].callback_param = NULL; in OSI_init()
81 for (index = 0; index < osi_info.mem_max_cnt; index++) { in OSI_deinit()
82 if (osi_info.mem[index]) free(osi_info.mem[index]); in OSI_deinit()
88 OSI_timer_free(&osi_info.timer[index]); in OSI_deinit()
90 osi_info.usingTimer = 0; in OSI_deinit()
93 void osi_lock() { pthread_mutex_lock(&osi_info.mutex); } in osi_lock()
95 void osi_unlock() { pthread_mutex_unlock(&osi_info.mutex); } in osi_unlock()