Lines Matching refs:lwptp

56 	lwp_timer_t *lwptp = arg;  in lwp_timer_timeout()  local
57 kthread_t *t = lwptp->lwpt_thread; in lwp_timer_timeout()
66 if (lwptp->lwpt_timecheck == timechanged && in lwp_timer_timeout()
67 (lwptp->lwpt_rqtime.tv_sec > now.tv_sec || in lwp_timer_timeout()
68 (lwptp->lwpt_rqtime.tv_sec == now.tv_sec && in lwp_timer_timeout()
69 lwptp->lwpt_rqtime.tv_nsec > now.tv_nsec))) { in lwp_timer_timeout()
70 lwptp->lwpt_imm_timeout = 0; in lwp_timer_timeout()
71 delta = lwptp->lwpt_rqtime; in lwp_timer_timeout()
73 lwptp->lwpt_id = timeout_generic(CALLOUT_REALTIME, in lwp_timer_timeout()
74 lwp_timer_timeout, lwptp, ts2hrt(&delta), nsec_per_tick, in lwp_timer_timeout()
84 (void) atomic_cas_uint(&lwptp->lwpt_imm_timeout, 0, 1); in lwp_timer_timeout()
95 lwp_timer_copyin(lwp_timer_t *lwptp, timespec_t *tsp) in lwp_timer_copyin() argument
102 lwptp->lwpt_timecheck = timechanged; /* do this before gethrestime() */ in lwp_timer_copyin()
105 if (copyin(tsp, &lwptp->lwpt_rqtime, sizeof (timespec_t))) { in lwp_timer_copyin()
115 TIMESPEC32_TO_TIMESPEC(&lwptp->lwpt_rqtime, &ts32); in lwp_timer_copyin()
117 if (itimerspecfix(&lwptp->lwpt_rqtime)) { in lwp_timer_copyin()
127 if (lwptp->lwpt_rqtime.tv_sec == 0 && lwptp->lwpt_rqtime.tv_nsec == 0) { in lwp_timer_copyin()
128 bzero(lwptp, sizeof (lwp_timer_t)); in lwp_timer_copyin()
129 lwptp->lwpt_imm_timeout = 1; in lwp_timer_copyin()
131 lwptp->lwpt_thread = curthread; in lwp_timer_copyin()
132 lwptp->lwpt_tsp = tsp; in lwp_timer_copyin()
133 lwptp->lwpt_time_error = 0; in lwp_timer_copyin()
134 lwptp->lwpt_id = 0; in lwp_timer_copyin()
135 lwptp->lwpt_imm_timeout = 0; in lwp_timer_copyin()
136 timespecadd(&lwptp->lwpt_rqtime, &now); in lwp_timer_copyin()
140 bzero(lwptp, sizeof (lwp_timer_t)); in lwp_timer_copyin()
141 lwptp->lwpt_time_error = error; in lwp_timer_copyin()
146 lwp_timer_enqueue(lwp_timer_t *lwptp) in lwp_timer_enqueue() argument
150 ASSERT(lwptp->lwpt_thread == curthread); in lwp_timer_enqueue()
153 if (lwptp->lwpt_timecheck == timechanged && in lwp_timer_enqueue()
154 (lwptp->lwpt_rqtime.tv_sec > now.tv_sec || in lwp_timer_enqueue()
155 (lwptp->lwpt_rqtime.tv_sec == now.tv_sec && in lwp_timer_enqueue()
156 lwptp->lwpt_rqtime.tv_nsec > now.tv_nsec))) { in lwp_timer_enqueue()
160 lwptp->lwpt_imm_timeout = 0; in lwp_timer_enqueue()
161 delta = lwptp->lwpt_rqtime; in lwp_timer_enqueue()
163 lwptp->lwpt_id = timeout_generic(CALLOUT_REALTIME, in lwp_timer_enqueue()
164 lwp_timer_timeout, lwptp, ts2hrt(&delta), nsec_per_tick, in lwp_timer_enqueue()
173 lwptp->lwpt_imm_timeout = 1; in lwp_timer_enqueue()
178 lwp_timer_dequeue(lwp_timer_t *lwptp) in lwp_timer_dequeue() argument
185 while ((tmp_id = lwptp->lwpt_id) != 0) { in lwp_timer_dequeue()
186 lwptp->lwpt_id = 0; in lwp_timer_dequeue()
196 lwp_timer_copyout(lwp_timer_t *lwptp, int error) in lwp_timer_copyout() argument
201 if (lwptp->lwpt_tsp == NULL) /* nothing to do */ in lwp_timer_copyout()
207 if ((now.tv_sec < lwptp->lwpt_rqtime.tv_sec) || in lwp_timer_copyout()
208 ((now.tv_sec == lwptp->lwpt_rqtime.tv_sec) && in lwp_timer_copyout()
209 (now.tv_nsec < lwptp->lwpt_rqtime.tv_nsec))) { in lwp_timer_copyout()
210 rmtime = lwptp->lwpt_rqtime; in lwp_timer_copyout()
215 if (copyout(&rmtime, lwptp->lwpt_tsp, sizeof (timespec_t))) in lwp_timer_copyout()
221 if (copyout(&rmtime32, lwptp->lwpt_tsp, sizeof (timespec32_t))) in lwp_timer_copyout()