Lines Matching refs:handle
61 HVFE_HANDLE handle; member
92 static int add_handle_to_index(HVFE_HANDLE handle, int index) in add_handle_to_index() argument
104 g_hvfe_handle[index].handle = handle; in add_handle_to_index()
123 if (g_hvfe_handle[i].handle == 0) { in find_empty_handle_index()
254 rc = video_fe_ioctl(g_hvfe_handle[fd_index].handle, cmd, data); in hypv_ioctl()
269 struct hypv_intercept *handle = (struct hypv_intercept *)context; in event_notify() local
273 pthread_mutex_lock(&handle->lock); in event_notify()
274 handle->event_flags[handle->event_q_rear++] = flags; in event_notify()
275 handle->event_q_rear %= MAX_EVENTS; in event_notify()
277 NUM_PENDING_EVENTS(handle->event_q_front, handle->event_q_rear), in event_notify()
278 handle->event_q_front, handle->event_q_rear); in event_notify()
279 pthread_cond_signal(&handle->cond); in event_notify()
280 pthread_mutex_unlock(&handle->lock); in event_notify()
289 struct hypv_intercept *handle = &g_hvfe_handle[fd_index]; in exit_thread() local
299 handle->exit_flag = true; in exit_thread()
300 pthread_cond_signal(&handle->cond); in exit_thread()
326 struct hypv_intercept *handle = &g_hvfe_handle[fd_index]; in hypv_poll() local
333 if (handle->thread_id == 0) { in hypv_poll()
334 if (pthread_create(&handle->thread_id, 0, exit_thread, fds)) { in hypv_poll()
335 handle->thread_id = 0; in hypv_poll()
340 pthread_mutex_lock(&handle->lock); in hypv_poll()
341 if (!NUM_PENDING_EVENTS(handle->event_q_front, handle->event_q_rear) && in hypv_poll()
342 !handle->exit_flag) { in hypv_poll()
343 ret = pthread_cond_timedwait(&handle->cond, &handle->lock, &ts); in hypv_poll()
354 if (handle->exit_flag == true) { in hypv_poll()
357 handle->exit_flag = false; in hypv_poll()
358 handle->thread_id = 0; in hypv_poll()
360 fds[0].revents = handle->event_flags[handle->event_q_front++]; in hypv_poll()
361 handle->event_q_front %= MAX_EVENTS; in hypv_poll()
364 … NUM_PENDING_EVENTS(handle->event_q_front, handle->event_q_rear)); in hypv_poll()
369 pthread_mutex_unlock(&handle->lock); in hypv_poll()
395 rc = video_fe_close(g_hvfe_handle[fd_index].handle); in hypv_close()
396 g_hvfe_handle[fd_index].handle = 0; in hypv_close()