Lines Matching refs:state

55 timerfd_itimer_lock(timerfd_state_t *state)  in timerfd_itimer_lock()  argument
57 itimer_t *it = &state->tfd_itimer; in timerfd_itimer_lock()
59 mutex_enter(&state->tfd_lock); in timerfd_itimer_lock()
63 cv_wait(&it->it_cv, &state->tfd_lock); in timerfd_itimer_lock()
69 mutex_exit(&state->tfd_lock); in timerfd_itimer_lock()
75 timerfd_itimer_unlock(timerfd_state_t *state, itimer_t *it) in timerfd_itimer_unlock() argument
77 VERIFY(it == &state->tfd_itimer); in timerfd_itimer_unlock()
80 mutex_enter(&state->tfd_lock); in timerfd_itimer_unlock()
87 mutex_exit(&state->tfd_lock); in timerfd_itimer_unlock()
93 timerfd_state_t *state = it->it_frontend; in timerfd_fire() local
96 mutex_enter(&state->tfd_lock); in timerfd_fire()
97 oval = state->tfd_fired++; in timerfd_fire()
98 mutex_exit(&state->tfd_lock); in timerfd_fire()
101 cv_broadcast(&state->tfd_cv); in timerfd_fire()
102 pollwakeup(&state->tfd_pollhd, POLLRDNORM | POLLIN); in timerfd_fire()
110 timerfd_state_t *state; in timerfd_open() local
128 state = ddi_get_soft_state(timerfd_softstate, minor); in timerfd_open()
131 state->tfd_next = timerfd_state; in timerfd_open()
132 timerfd_state = state; in timerfd_open()
143 timerfd_state_t *state; in timerfd_read() local
151 state = ddi_get_soft_state(timerfd_softstate, minor); in timerfd_read()
153 mutex_enter(&state->tfd_lock); in timerfd_read()
155 while (state->tfd_fired == 0) { in timerfd_read()
157 mutex_exit(&state->tfd_lock); in timerfd_read()
161 if (!cv_wait_sig_swap(&state->tfd_cv, &state->tfd_lock)) { in timerfd_read()
162 mutex_exit(&state->tfd_lock); in timerfd_read()
170 val = state->tfd_fired; in timerfd_read()
171 state->tfd_fired = 0; in timerfd_read()
172 mutex_exit(&state->tfd_lock); in timerfd_read()
184 timerfd_state_t *state; in timerfd_poll() local
188 state = ddi_get_soft_state(timerfd_softstate, minor); in timerfd_poll()
190 mutex_enter(&state->tfd_lock); in timerfd_poll()
192 if (state->tfd_fired > 0) in timerfd_poll()
196 *phpp = &state->tfd_pollhd; in timerfd_poll()
198 mutex_exit(&state->tfd_lock); in timerfd_poll()
253 timerfd_state_t *state; in timerfd_ioctl() local
258 state = ddi_get_soft_state(timerfd_softstate, minor); in timerfd_ioctl()
265 it = timerfd_itimer_lock(state); in timerfd_ioctl()
268 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
273 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
288 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
292 it->it_frontend = state; in timerfd_ioctl()
293 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
299 it = timerfd_itimer_lock(state); in timerfd_ioctl()
302 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
307 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
327 it = timerfd_itimer_lock(state); in timerfd_ioctl()
330 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
338 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
367 mutex_enter(&state->tfd_lock); in timerfd_ioctl()
368 state->tfd_fired = 0; in timerfd_ioctl()
369 mutex_exit(&state->tfd_lock); in timerfd_ioctl()
374 timerfd_itimer_unlock(state, it); in timerfd_ioctl()
396 timerfd_state_t *state, **sp; in timerfd_close() local
400 state = ddi_get_soft_state(timerfd_softstate, minor); in timerfd_close()
402 if (state->tfd_pollhd.ph_list != NULL) { in timerfd_close()
403 pollwakeup(&state->tfd_pollhd, POLLERR); in timerfd_close()
404 pollhead_clean(&state->tfd_pollhd); in timerfd_close()
411 it = &state->tfd_itimer; in timerfd_close()
421 for (sp = &timerfd_state; *sp != state; sp = &((*sp)->tfd_next)) in timerfd_close()